Software Design Patterns
Updated 2026-07-30
Summary
In software engineering, a design pattern is a solution to a commonly occurring problem in software design. The term was introduced to computer science from the field of architecture by Erich Gamma and others in the 1990s. Design patterns are not directly used to write code, but rather describe how to solve a problem in various situations. Object-oriented design patterns typically describe the relationships and interactions between classes or objects, but do not involve specific classes or objects used to complete the application. Design patterns can make unstable dependencies relatively stable, concrete dependencies relatively abstract, avoid tight coupling that causes trouble, and enhance the ability of software design to face and adapt to change. Not all software patterns are design patterns; design patterns specifically refer to problems at the 'design' level of software.
Definition
Reusable solution templates for recurring problems in software design. The classic 23 patterns are divided into: - Creational (e.g., Singleton, Factory) - Structural (e.g., Adapter, Decorator) - Behavioral (e.g., Observer, Strategy). Scaffolding role: using pattern language to improve design communication efficiency. Design patterns are the crystallization of experience; naming patterns allows teams to express complex design intentions with a single word, and also helps novices quickly learn mature solutions.
Introduction
How to use
Use pattern language to improve design communication efficiency. Design patterns are the crystallization of experience; naming patterns allows teams to express complex design intentions with a single word, and also helps novices quickly learn mature solutions.
Mechanism
Provide reusable solution templates for recurring design problems. The mechanism is to encapsulate changes, decouple responsibilities, and program to interfaces, improving maintainability and extensibility.
Practice
In progress 0/2Practice this model in one real situation:
Cases
- MVC separates UI and logic, Strategy pattern switches algorithms, Observer implements event notification.
Common pitfalls
- Over-engineering, forcing patterns can increase complexity; patterns are a means, not an end.
Sources
Source support: Explicit
References currently contain only Wikipedia links; primary sources still need review.
- zh.wikipedia.orghttps://zh.wikipedia.org/wiki/%E8%AE%BE%E8%AE%A1%E6%A8%A1%E5%BC%8F_%28%E8%AE%A1%E7%AE%97%E6%9C%BA%29verified
account_treeGenealogyexpand_more
PRIVATE NOTES · Only visible to you
SAVED Q&A
ENTRY Q&A · Private saving available
Ask with a clear boundary
thinkingmodels answers from published entry context only.
Your question is sent to thinkingmodels. The answer uses public entry context only.
RELATED MODELS