SOLID Principles
Updated 2026-07-30
Summary
Five golden rules for building robust systems
Definition
Five golden rules for building robust systems. - SRP: Single Responsibility (a module should do only one thing). - OCP: Open/Closed Principle (open for extension, closed for modification). - LSP: Liskov Substitution (subtypes can replace their base types). - ISP: Interface Segregation (do not depend on interfaces you do not use). - DIP: Dependency Inversion (depend on abstractions, not concretions). Scaffold use: - System aesthetics: not only in coding, but also in designing department structures, SOLID should be followed. For example, SRP: if a department's responsibilities are not single, it will inevitably lead to buck-passing and inefficiency.
Introduction
How to use
- System aesthetics: not only in coding, but also in designing department structures, SOLID should be followed. For example, SRP: if a department's responsibilities are not single, it will inevitably lead to buck-passing and inefficiency.
Mechanism
The five design principles together reduce coupling, increase cohesion and extensibility: SRP ensures changes only affect one place, OCP handles change through extension rather than modification, LSP guarantees safe inheritance semantics, ISP reduces interface pollution, and DIP makes high-level modules not depend on low-level details. They constrain design from five angles: responsibility, extension, substitution, interface, and dependency, making the system easier to modify, test, and evolve.
Practice
In progress 0/1Practice this model in one real situation:
Cases
- Putting 'send email' and 'log' in the same class violates SRP; extracting a Notification interface and letting high-level modules depend on it instead of concrete implementations applies DIP.
Common pitfalls
- Over-abstracting for SOLID, creating many empty interfaces that are hard to understand; mechanically applying it in small scripts is often not worth the effort.
Sources
Source support: Explicit
References currently contain only Wikipedia links; primary sources still need review.
- en.wikipedia.orghttps://en.wikipedia.org/wiki/SOLIDverified
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