Cognitive Scaffold

Preparing your thinking workspace

arrow_back_ios_new
MENTAL MODEL · M0531

Factory Pattern

Factory Pattern
StructureHigh supportLogic
Included
account_tree

Version 1.0.0 · Updated 2026-07-30

CORE DEFINITION

Define an interface for creating an object, but let subclasses decide which class to instantiate. Factory Method lets a class defer instantiation to subclasses.

SCAFFOLDING EFFECT

psychology

Reduce cognitive load

Encapsulate change. In mental models, this means establishing an 'intermediate layer' to handle uncertainty. Do not directly depend on specific people or things (hard-coding), but rely on a 'generation mechanism'. When the environment changes, only the factory logic needs to be modified, without having to start over.

anchor

Anchor fast decisions

Define an interface for creating objects, deferring instantiation of concrete classes to subclasses or factory methods; the caller only depends on the abstract product, not the concrete implementation, thereby reducing coupling and encapsulating change points.

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
    en.wikipedia.orghttps://en.wikipedia.org/wiki/Factory_method_patternZH · Explicit
    verified

RELATED MODELS