Junior — Middle
Can you list the main design patterns used in object-oriented programming?
sobes.tech AI
Answer from AI
The main design patterns in object-oriented programming are divided into three groups:
-
Creational — responsible for object creation:
- Singleton
- Factory Method
- Abstract Factory
- Builder
- Prototype
-
Structural — define ways to compose classes and objects:
- Adapter
- Decorator
- Facade
- Composite
- Proxy
- Bridge
- Flyweight
-
Behavioral — responsible for interactions between objects:
- Observer
- Strategy
- Command
- Iterator
- State
- Template Method
- Mediator
- Chain of Responsibility
These patterns help write flexible, extendable, and maintainable code.