Middle
Ποιες ταξινομήσεις σχεδιαστικών προτύπων γνωρίζετε;
sobes.tech AI
Απάντηση από AI
There are three main classifications of design patterns, based on their purpose:
- Creational: Related to object creation. They help make the system independent of the way objects are created, composed, and represented.
- Factory Method
- Abstract Factory
- Builder
- Singleton
- Prototype
- Structural: Explain how larger structures are formed from classes and objects.
- 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 |