Cognitive Scaffold

Preparing your thinking workspace

arrow_back_ios_new
MENTAL MODEL · M1239

Open/Closed Principle

Open/Closed Principle
CreateHigh supportDesign Thinking
Included
account_tree

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

psychology

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

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/4

Practice this model in one real situation:

Check to track your progress (stored locally)
Learning progress0%
account_treeGenealogyexpand_more
menu_bookReferencesexpand_more

Source support: Explicit

  • link
    zh.wikipedia.orghttps://zh.wikipedia.org/wiki/%E5%BC%80%E9%97%AD%E5%8E%9F%E5%88%99ZH · Explicit
    verified

RELATED MODELS