Skip to content

faragh47/DesignPatterns

Repository files navigation

DesignPatterns

design patterns in Net7.0

I watch Mosh Hamedani Design Patterns Video and for practice i decided to create this Repository.

What is Design Pattern:

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.

Technologies

ASP.NET Core 7

Getting Started

The easiest way to get started is to install the NuGet package and run dotnet new ca-sln:

  1. Install the latest .NET 7 SDK
  2. Run dotnet new ca-sln to create a new project
  3. Navigate to src/DesignPattern and launch the project using dotnet run

Overview

Memento

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.

memento UML

State

The State design pattern allows an object to alter its behavior when its internal state changes. The object will appear to change its class.

state UML

Iterator

The Iterator design pattern provides a way to access the elements of an aggregate object sequentially without exposing its underlying representation.

Iterator UML

Strategy

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.

Strategy UML

Mediator

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.

Mediator UML

About

design-patterns-in-Net7.0

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages