Middle
What design pattern classifications are you familiar with?
sobes.tech AI
Answer from AI
Design patterns are classified by two main features: purpose and application area.
By purpose:
- Creational patterns: Describe ways to create objects, hiding the creation logic and optimizing this process.
- Structural patterns: Describe ways to combine classes and objects into larger structures, simplifying the design of complex systems.
- Behavioral patterns: Describe ways objects interact and distribute responsibilities, improving system flexibility and extendability.
By application area:
- Class patterns: Related to relationships between classes, determined at compile time, and use inheritance.
- Object patterns: Related to relationships between objects, determined at runtime, and use composition and delegation.
Examples of patterns from the "Gang of Four" (GoF) categories:
| Purpose | Patterns |
|---|---|
| Creational | Abstract Factory, Builder, Factory Method, Prototype, Singleton |
| Structural | Adapter (objects), Bridge, Composite, Decorator, Facade, Flyweight, Proxy |
| Behavioral | Chain of Responsibility, Command, Iterator, Mediator, Memento, Observer, Strategy, Template Method, Visitor |