Skip to content

simphiweFP/DesignPatterns

Repository files navigation

🎯 Design Patterns

This project demonstrates a comprehensive implementation of Creational, Structural, and Behavioral design patterns using clean, maintainable code.

Each pattern is implemented with real-world use cases to highlight its:

  • Intent 🧠
  • Structure 🧱
  • Flexibility 🔁

🧰 This repository reflects my understanding of software architecture, object-oriented principles, and design best practices.


📁 Project Structure

image


✨ Creational Design Patterns

Goal: Abstract the instantiation process to make the system independent of how objects are created.

  • 🧍 Singleton – Ensures a class has only one instance and provides a global access point.
  • 🏭 Factory Method – Defines an interface for creating an object but lets subclasses decide which class to instantiate.
  • 🏢 Abstract Factory – Produces families of related objects without specifying their concrete classes.
  • 🔧 Builder – Constructs a complex object step-by-step and allows customization of the representation.
  • 📋 Prototype – Clones existing objects instead of creating new ones from scratch.

🧱 Structural Design Patterns

Goal: Define how objects and classes are composed to form larger, flexible structures.

  • 🔌 Adapter – Converts one interface into another that clients expect.
  • 🌉 Bridge – Decouples an abstraction from its implementation so both can vary independently.
  • 🌲 Composite – Treats individual objects and compositions uniformly in a tree structure.
  • 🎁 Decorator – Adds new behavior to objects dynamically without modifying their structure.
  • 🎯 Facade – Simplifies a complex system by exposing a unified interface.
  • 📦 Flyweight – Shares common state between many objects to save memory.
  • 🕵️ Proxy – Provides a placeholder to control access to another object.

🔄 Behavioral Design Patterns

Goal: Focus on how objects interact and distribute responsibility.

  • 🧾 Chain of Responsibility – Passes requests along a chain of handlers until one handles it.
  • 🕹️ Command – Encapsulates a request as an object, allowing flexible parameterization and execution.
  • 🗣️ Interpreter – Evaluates language grammar or expression trees.
  • 🔁 Iterator – Accesses elements of a collection sequentially without exposing its structure.
  • 📡 Mediator – Centralizes complex communications between related objects.
  • 🧠 Memento – Captures and restores an object’s previous state.
  • 👀 Observer – Notifies multiple objects of changes in another object’s state.
  • 🎭 State – Allows an object to change its behavior when its internal state changes.
  • ⚙️ Strategy – Enables selecting an algorithm’s behavior at runtime.
  • 📄 Template Method – Defines the skeleton of an algorithm with customizable steps.

✅ Skills Demonstrated

  • 📌 Mastery of object-oriented programming (OOP) principles
  • 🔄 Application of SOLID design principles
  • ♻️ Reusable and maintainable code structure
  • 💡 Effective use of abstraction, encapsulation, and polymorphism

🏃‍♂️ Quick Start

Follow these steps to run the interactive Design Pattern console app:

1. 📦 Clone the Repository

git clone https://github.com/your-username/DesignPatterns.git
cd DesignPatterns
dotnet build
dotnet run --project DesignPatterns

🧭 Interactive Console Experience
After launching, the app will guide you through:

🧩 Choose a Design Pattern Category:
1 – Creational

2 – Structural

3 – Behavioral

📌 Then select a specific pattern to:
✅ View the implementation

✅ Understand its intent and design

✅ See real-world-like output simulating its usage

🎓 This project is ideal for developers learning or revising software design patterns in an applied and interactive way.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages