Design Pattern
A reusable solution template to a commonly occurring software design problem.
Definition
A design pattern is a general, reusable solution to a commonly occurring problem in software design. Patterns provide templates that can be adapted to specific situations rather than prescriptive code. The classic Gang of Four book categorizes patterns as creational (Singleton, Factory, Builder), structural (Adapter, Decorator, Facade), and behavioral (Observer, Strategy, Command). Design patterns improve communication between developers by providing shared vocabulary and codify proven best practices.
Example
“The Observer pattern is used in React's event system — components subscribe to events, and when a button emits a click event, all subscribers are notified automatically.”
Synonyms
- software pattern
- architectural pattern
- code template
- best practice template
Antonyms / Opposites
- anti-pattern
- code smell
Images
CC-licensed · free to useVideo
Related Terms
- object-oriented-programming
- singleton
- factory-pattern
- software-architecture
