Skip to content

Latest commit

 

History

24 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GoF Design Patterns in C# (Backend Focused)

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.

✅ Implemented Design Patterns (Ordered by usefulness in backend)

  1. Strategy (Behavioral) - Example
  2. Observer (Behavioral) - Example
  3. Factory Method (Creational) - Example
  4. Decorator (Structural) - Example
  5. Adapter (Structural) - Example
  6. Command (Behavioral) - Example
  7. Singleton (Creational) - Example
  8. Builder (Creational) - Example
  9. Proxy (Structural) - Example
  10. Chain of Responsibility (Behavioral) - Example
  11. Composite (Structural) - Example
  12. Template Method (Behavioral) - Example
  13. Facade (Structural) - Example
  14. State (Behavioral) - Example
  15. Abstract Factory (Creational) - Example
  16. Mediator (Behavioral) - Example
  17. Bridge (Structural) - Example
  18. Flyweight (Structural) - Example
  19. Prototype (Creational) - Example
  20. Iterator (Behavioral) - Example
  21. Memento (Behavioral) - Example
  22. Interpreter (Behavioral) - Example
  23. Visitor (Behavioral) - Example

Implemented Design Patterns Categorized into Behavioral, Structural and Creational

🎯 Behavioral Patterns

  1. Strategy (Behavioral) - Example
  2. Observer (Behavioral) - Example
  3. Command (Behavioral) - Example
  4. Chain of Responsibility (Behavioral) - Example
  5. Template Method (Behavioral) - Example
  6. State (Behavioral) - Example
  7. Mediator (Behavioral) - Example
  8. Iterator (Behavioral) - Example
  9. Memento (Behavioral) - Example
  10. Interpreter (Behavioral) - Example
  11. Visitor (Behavioral) - Example

🏗️ Structural Patterns

  1. Decorator (Structural) - Example
  2. Adapter (Structural) - Example
  3. Proxy (Structural) - Example
  4. Composite (Structural) - Example
  5. Facade (Structural) - Example
  6. Bridge (Structural) - Example
  7. Flyweight (Structural) - Example

🧱 Creational Patterns

  1. Factory Method (Creational) - Example
  2. Singleton (Creational) - Example
  3. Builder (Creational) - Example
  4. Abstract Factory (Creational) - Example
  5. Prototype (Creational) - Example

🧠 About

  • 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

👋 Let’s Connect

About

No description, website, or topics provided.

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages