Factory Pattern
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
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 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/4Practice this model in one real situation:
account_treeGenealogyexpand_more
menu_bookReferencesexpand_more
Source support: Explicit
- en.wikipedia.orghttps://en.wikipedia.org/wiki/Factory_method_patternverified
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