Design patterns are standard solutions to common problems in software design. They represent best practices, providing a way to structure code in a way that's reusable, maintainable, and understandable. Patterns can be classified into three types: creational (for object creation), structural (for object relationships), and behavioral (for object interactions and responsibility distribution).
Important The "Gamma categorization" refers to the classification of design patterns proposed in the book "Design Patterns: Elements of Reusable Object-Oriented Software" by Erich Gamma and others. It categorizes design patterns into three types:
- Creational Patterns
- Deal with the creation (construction) of objects
- Explicit (constructor) vs. implicit (DI, reflection, etc.)
- Wholesale (single statement) vs. piecewise (step-by-step)
- Structural Patterns
- Concerned with the structure (e.g., class members)
- Many patterns are wrappers that mimic the underlying classโ interface
- Stress the importance of good API design
- Behavioral Patterns
- They are all different; no central theme
GPT4 was used to generate explanations.
Examples from the course:
Design Patterns in C# and .NET: Learn Solutions to Common Problems
Found on rutracker.org