Design patterns are solutions to recurring problems; guidelines on how to tackle certain problems. I have included implementations of some design patterns in C# to help beginners like me get their feet wet. There are better alternatives available for some of them in the .NET Framework, so this is by no means a comprehensive tutorial.
Any comments and suggestions are welcome. If you want to add a new design pattern implementation, just follow the naming convention, fork my repo and submit a pull request. Same goes for any improvements and modifications.
There are three kinds of Design Patterns:
- Creational
- Structural
- Behavioral
- Adapter
- Bridge
- Command
- Composite
- Decorator
- Facade
- Factory
- Flyweight
- Iterator
- Observer
- Singleton
- State
- Strategy
- Template
- Visitor
- Mediator
- Proxy
To install missing framework, download:
https://dotnet.microsoft.com/zh-cn/download/dotnet/2.1/runtime?cid=getdotnetcore
cd
to a certain pattern sub-folder, and dotnet run
. Or, you can use batch_dotnet_run.sh
directly.