I watch Mosh Hamedani Design Patterns Video and for practice i decided to create this Repository.
Design patterns provide general solutions or a flexible way to solve common design problems. This article provides an introduction of design patterns and how design patterns are implemented in C# and .NET.
ASP.NET Core 7
The easiest way to get started is to install the NuGet package and run dotnet new ca-sln:
- Install the latest .NET 7 SDK
- Run dotnet new ca-sln to create a new project
- Navigate to src/DesignPattern and launch the project using dotnet run
The Memento design pattern without violating encapsulation, captures and externalizes an object‘s internal state so that the object can be restored to this state late.
The State design pattern allows an object to alter its behavior when its internal state changes. The object will appear to change its class.
The Iterator design pattern provides a way to access the elements of an aggregate object sequentially without exposing its underlying representation.
The Strategy design pattern defines a family of algorithms, encapsulate each one, and make them interchangeable. This pattern lets the algorithm vary independently from clients that use it.
is a behavioral design pattern that lets you reduce chaotic dependencies between objects. The pattern restricts direct communications between the objects and forces them to collaborate only via a mediator object.