Skip to content

Real-world implementation of classic design patterns in C# (.NET) with clean code, analogies, and step-by-step documentation

Notifications You must be signed in to change notification settings

rezatajari/CommonDesignPatterns

Repository files navigation

Common Design Patterns in Action (C# .NET)

Welcome to the CommonDesignPatterns repository — a hands-on showcase of the most widely used Object-Oriented Design Patterns implemented in C# (.NET). This repo is built not just for demonstration, but for learning-by-doing and explaining each pattern clearly with real-world analogies.


Purpose

This project is a collection of classic design patterns — each pattern is implemented with clean, real-world use cases, and accompanied by clear explanations in the documentation.

Ideal for:

  • Learners mastering C# OOP principles
  • Developers strengthening their architecture skills
  • Engineers looking for reusable, understandable pattern templates

Implemented Patterns

Pattern Name Category Status Description Link to Doc
✅ Singleton Creational Completed Ensures only one instance of a class exists globally Documentation
✅ Factory Creational Completed Creates objects without specifying the exact class Documentation
✅ Strategy Behavioral Completed Selects algorithm behavior at runtime Documentation
✅ Mediator Behavioral Completed Facilitates communication between objects to reduce dependencies Documentation
✅ Adapter Structural Completed Converts incompatible interfaces so they can work together Documentation
✅ Bridge Structural Completed Decouples abstraction from implementation to allow independent variation Documentation

Documentation Format

Each pattern includes:

  • Real-world analogy (e.g., MediaPlayer for Adapter)
  • Core interfaces and class structure
  • Example use case
  • Conceptual explanation (no code when clarity matters)
  • Key takeaways — when and why to use the pattern

About

Real-world implementation of classic design patterns in C# (.NET) with clean code, analogies, and step-by-step documentation

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages