Open/Closed Principle
Version 1.0.0 · Updated 2026-07-30
CORE DEFINITION
Software entities (classes, modules, functions) should be open for extension but closed for modification. That is, new functionality is introduced by adding new code without modifying existing code.
SCAFFOLDING EFFECT
Reduce cognitive load
Architecture that embraces change. When designing rules or processes, reserve "plugin interfaces." When new situations arise, there is no need to start over (modification); just plug in a new plugin (extension).
Anchor fast decisions
The Open/Closed Principle (OCP) requires that software entities be open for extension and closed for modification: new behaviors should be added through extension rather than by altering existing code, thereby reducing regression risk and improving stability.
MINIMUM ACTION
In progress 0/4Practice this model in one real situation:
account_treeGenealogyexpand_more
menu_bookReferencesexpand_more
Source support: Explicit
- zh.wikipedia.orghttps://zh.wikipedia.org/wiki/%E5%BC%80%E9%97%AD%E5%8E%9F%E5%88%99verified
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