This project provides practical examples of all 23 classic design patterns implemented in C#.
The project is organized into three main categories:
DesignPatternsDemo/
β
βββ 1.Creational/
β βββ A.Singleton
β βββ B.Factory Method
β βββ C.Abstract Factory
β βββ D.Builder
β βββ E.Prototype
β
βββ 2.Structural/
β βββ A.Adapter
β βββ B.Bridge
β βββ C.Composite
β βββ D.Decorator
β βββ E.Facade
β βββ F.Flyweight
β βββ G.Proxy
β
βββ 3.Behavioral/
β βββ A.Chain of Responsibility
β βββ B.Command
β βββ C.Interpreter
β βββ D.Iterator
β βββ E.Mediator
β βββ F.Memento
β βββ G.Observer
β βββ H.State
β βββ I.Strategy
β βββ J.Template Method
β βββ K.Visitor
π Category | π Focus | π‘ Key Idea |
---|---|---|
π οΈ Creational | Object creation | Hide or control object instantiation |
ποΈ Structural | Object composition | Build flexible and reusable structures |
π€ Behavioral | Object communication | Manage how objects cooperate and behave |
- Open the solution in Visual Studio.
- Build the project.
- Run the
Program.cs
to see all design pattern examples in action.
- Design Patterns: Elements of Reusable Object-Oriented Software by Gamma, Helm, Johnson, and Vlissides (Gang of Four)
Feel free to explore each pattern folder to understand their individual implementations. Happy learning! π