Middle
What design pattern classifications do you know?
sobes.tech AI
Answer from AI
The main classifications of design patterns include:
-
By purpose:
- Creational: Describe ways to create objects, increasing flexibility and reusability.
- Structural: Describe ways to combine classes and objects into larger structures.
- Behavioral: Describe algorithms and distribution of responsibilities among objects.
-
By application area:
- Class patterns: Describe static relationships between classes, fixed at compile time. Use inheritance to create abstract relationships.
- Object patterns: Describe dynamic relationships between objects, which can change during runtime. Use composition to create links.
For example, the Factory Method pattern is a creational pattern related to class patterns, while the Strategy pattern is behavioral and related to object patterns.