This repository contains practical examples of various design patterns implemented in C#. Each pattern is implemented in its own independent project, making it easy to understand and run separately.
The solution is organized into different categories of design patterns:
- Factory Method
- Abstract Factory
- Builder
- Prototype
- Singleton
- Adapter
- Bridge
- Composite
- Decorator
- Facade
- Flyweight
- Proxy
- Chain of Responsibility
- Command
- Iterator
- Mediator
- Memento
- Observer
- State
- Strategy
- Template Method
- Visitor
- Clone the repository
- Open the solution file in Visual Studio
- Select the specific pattern project you want to run
- Build and run the project
- .NET 8.0 SDK or later
- Visual Studio 2022 or later
Each pattern is implemented in its own project folder with the following structure:
PatternName/
├── Program.cs
├── README.md (Pattern-specific documentation)
└── Implementation files
To run a specific pattern example:
- Open the solution in Visual Studio
- Set the desired pattern project as the startup project
- Press F5 or click Run
Feel free to contribute by:
- Forking the repository
- Creating a new branch
- Making your changes
- Submitting a pull request
This project is licensed under the MIT License - see the LICENSE file for details.