Middle
What classifications of design patterns do you know?
sobes.tech AI
Answer from AI
There are three main classifications of design patterns based on their purpose:
- Creational: Related to object creation. They help make a system independent of the way objects are created, composed, and represented.
- Factory Method
- Abstract Factory
- Builder
- Singleton
- Prototype
- Structural: Explain how classes and objects form larger structures.
- Adapter
- Bridge
- Composite
- Decorator
- Facade
- Flyweight
- Proxy
- Behavioral: Define algorithms of interaction between objects and the distribution of responsibilities among them.
- Chain of Responsibility
- Command
- Interpreter
- Iterator
- Mediator
- Memento
- Observer
- State
- Strategy
- Template Method
- Visitor
There is also a classification based on the level of application:
- Class Patterns: Describe static relationships between classes (inheritance).
- Object Patterns: Describe dynamic relationships between objects (composition).
For example:
| Category | Type | Example |
|---|---|---|
| Creational | Object | Factory Method |
| Structural | Class | Adapter |
| Behavioral | Object | Strategy |