This repository contains the most popular design patterns in C# (.NET) with examples.
What is a design pattern?
A design pattern is a general reusable solution to a commonly occurring problem within a given context in software design. A design pattern is not a finished design that can be transformed directly into code. It is a description or template for how to solve a problem that can be used in many different situations.
Object-oriented programming (OOP) is a programming paradigm based on the concept of "objects", which can contain data, in the form of fields (often known as attributes or properties), and code, in the form of procedures (often known as methods).
SOLID is an acronym for the first five object-oriented design (OOD) principles by Robert C. Martin. These principles intend to make software designs more understandable, flexible, and maintainable.
- Single Responsibility Principle (SRP)
- Open/Closed Principle (OCP)
- Liskov Substitution Principle (LSP)
- Interface Segregation Principle (ISP)
- Dependency Inversion Principle (DIP)
Creational design patterns are design patterns that deal with object creation mechanisms, trying to create objects in a manner suitable to the situation.
Structural design patterns are design patterns that ease the design by identifying a simple way to realize relationships between entities.
Behavioral design patterns are design patterns that identify common communication patterns between objects and realize these patterns.