The Gang of Four (GoF) design patterns implemented in C# (real world examples)
Design patterns are solutions to software design problems you find again and again in real-world application development. Patterns are about reusable designs and interactions of objects. The 23 Gang of Four (GoF) patterns are generally considered the foundation for all other patterns. They are categorized in three groups: Creational, Structural, and Behavioral.
- ABSTRACT FACOTRY
Creates an instance of several families of classes
✔️ - BUILDER
Separates object construction from its representation
✔️ - FACTORY
Creates an instance of several derived classes
✔️ - PROTOTYPE
A fully initialized instance to be copied or cloned
⏳ - SINGLETON
A class of which only a single instance can exist
✔️
- ADAPTER
Match interfaces of different classes
⏳ - BRIDGE
Separates an object’s interface from its implementation
⏳ - COMPOSITE
A tree structure of simple and composite objects
✔️ - DECORATOR
Add responsibilities to objects dynamically
⏳ - FACADE
A single class that represents an entire subsystem
✔️ - FLYWEIGHT
A fine-grained instance used for efficient sharing
✔️ - PROXY
An object representing another object
✔️
- CHAIN OF RESP.
A way of passing a request between a chain of objects
✔️ - COMMAND
Encapsulate a command request as an object
✔️ - INTERPRETER
A way to include language elements in a program
⏳ - INTERATOR
Sequentially access the elements of a collection
✔️ - MEDIATOR
Defines simplified communication between classes
⏳ - MEMENTO
Capture and restore an object's internal state
⏳ - OBSERVER
A way of notifying change to a number of classes
✔️ - STATE
Alter an object's behavior when its state changes
✔️ - STRATEGY
Encapsulates an algorithm inside a class
✔️ - TEMPLATE
Method Defer the exact steps of an algorithm to a subclass
✔️ - VISITOR
Defines a new operation to a class without change
⏳