Design Pattern
- •
What it is
- •
a reusable, generic solution to a commonly occurrin software design problem within a given context
- •
- •
What it is / isn't
- •
a solution pattern, not ready-made code — proven effective through repeated real-world use
- •
- •
Benefits
- •
documents a validated solution as part of a team's shared design knowledge
- •
becomes a recorded design artifact once represented in class/sequence diagrams
- •
improves design consistency across teams
- •
gives teams a concise shared vocabulary ("use a Decorator here") instead of re-explaining a solution from scratch
- •
supports reusability and maintainability, since the solution and its rationale are already documented
- •
- •
Categories
- •
creational — flexible object creation, decoupled from concrete implementations (e.g. Singleton, Factory Method, Abstract Factory, Builder, Prototype)
- •
structural — composing classes/objects into larger, efficient structures (e.g. Adapter, Bridge, Composite, Decorator, Facade, Flyweight, Proxy)
- •
behavioral — managing interaction, communication patterns, and process flow between objects (e.g. Observer, Strategy, Command, State, Template Method, Chain of Responsibility, Mediator, Memento, Visitor, Iterator, Interpreter)
- •
- •
- •