Senior
What are the types/groups of design patterns?
sobes.tech AI
Answer from AI
Design patterns are proven solutions to common software design problems. They are usually divided into three main groups:
-
Creational Patterns — responsible for object creation, hiding complexity and providing flexibility:
- Singleton
- Factory Method
- Abstract Factory
- Builder
- Prototype
-
Structural Patterns — define ways to compose classes and objects into larger structures:
- Adapter
- Composite
- Proxy
- Decorator
- Facade
- Bridge
- Flyweight
-
Behavioral Patterns — describe interactions between objects and the distribution of responsibilities:
- Observer
- Strategy
- Command
- Iterator
- Mediator
- State
- Template Method
In Go, patterns are often applied considering the language's features, such as using interfaces to implement Strategy or Observer.