An open API service indexing awesome lists of open source software.

https://github.com/mf-rl/design.patterns.demo

This project provides practical examples of all 23 classic design patterns implemented in C#.
https://github.com/mf-rl/design.patterns.demo

csharp design-patterns design-patterns-csharp design-patterns-example design-patterns-examples examples

Last synced: 5 months ago
JSON representation

This project provides practical examples of all 23 classic design patterns implemented in C#.

Awesome Lists containing this project

README

          

# Design Patterns in C#

This project provides practical examples of all **23 classic design patterns** implemented in C#.

## 🗂️ Summary Table

| 📂 Category | 🔍 Focus | 💡 Key Idea |
|-------------------|------------------------|----------------------------------------------|
| 🛠️ [Creational](https://github.com/mf-rl/Design.Patterns.Demo/tree/master/Design.Patterns.Demo/1.Creational/README.md) | Object creation | Hide or control object instantiation |
| 🏗️ [Structural](https://github.com/mf-rl/Design.Patterns.Demo/tree/master/Design.Patterns.Demo/2.Structural/README.md) | Object composition | Build flexible and reusable structures |
| 🤝 [Behavioral](https://github.com/mf-rl/Design.Patterns.Demo/tree/master/Design.Patterns.Demo/3.Behavioral/README.md) | Object communication | Manage how objects cooperate and behave |

---

## 📂 Project Structure

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

```
---

## 🚀 Running the Project

1. Open the solution in **Visual Studio**.
2. Build the project.
3. Run the `Program.cs` to see all design pattern examples in action.

---

## 📚 References
- *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! 😊