This repository contains real-world backend-focused examples of the Gang of Four (GoF) design patterns using C#. The goal of this project is to learn and understand the design patterns and how these can be implemented.
Each pattern includes a Bad version and a Refactored version, along with a runnable Program.cs for comparison.
- Strategy (Behavioral) - Example
- Observer (Behavioral) - Example
- Factory Method (Creational) - Example
- Decorator (Structural) - Example
- Adapter (Structural) - Example
- Command (Behavioral) - Example
- Singleton (Creational) - Example
- Builder (Creational) - Example
- Proxy (Structural) - Example
- Chain of Responsibility (Behavioral) - Example
- Composite (Structural) - Example
- Template Method (Behavioral) - Example
- Facade (Structural) - Example
- State (Behavioral) - Example
- Abstract Factory (Creational) - Example
- Mediator (Behavioral) - Example
- Bridge (Structural) - Example
- Flyweight (Structural) - Example
- Prototype (Creational) - Example
- Iterator (Behavioral) - Example
- Memento (Behavioral) - Example
- Interpreter (Behavioral) - Example
- Visitor (Behavioral) - Example
- Strategy (Behavioral) - Example
- Observer (Behavioral) - Example
- Command (Behavioral) - Example
- Chain of Responsibility (Behavioral) - Example
- Template Method (Behavioral) - Example
- State (Behavioral) - Example
- Mediator (Behavioral) - Example
- Iterator (Behavioral) - Example
- Memento (Behavioral) - Example
- Interpreter (Behavioral) - Example
- Visitor (Behavioral) - Example
- Decorator (Structural) - Example
- Adapter (Structural) - Example
- Proxy (Structural) - Example
- Composite (Structural) - Example
- Facade (Structural) - Example
- Bridge (Structural) - Example
- Flyweight (Structural) - Example
- Factory Method (Creational) - Example
- Singleton (Creational) - Example
- Builder (Creational) - Example
- Abstract Factory (Creational) - Example
- Prototype (Creational) - Example
- All examples are backend-centric
- Built using C# with runnable projects
- Clean separation of Bad vs Refactored
- Ideal for learning, interviews, and real-world projects
- LinkedIn: sayyedulawwab
- Website: sayyedulawwab.com