Cognitive Scaffold

Preparing your thinking workspace

arrow_back_ios_new
MENTAL MODEL · M6312

Dependency Injection

Dependency Injection
CreateHigh supportDesign Thinking
Included
account_tree

Version 1.0.0 · Updated 2026-07-30

CORE DEFINITION

Objects should not create the dependencies they need themselves, but rather have an external container inject the dependency objects at runtime. This implements Inversion of Control (IoC) and reduces coupling.

SCAFFOLDING EFFECT

psychology

Reduce cognitive load

Plug-and-play resources. Do not bind your capabilities to a specific platform or resource (hardcoding). Design yourself as an 'interface', with required resources (funds, connections) injected externally. This way you can switch platforms at any time without refactoring yourself.

anchor

Anchor fast decisions

An implementation of Inversion of Control (IoC): objects do not create dependencies themselves, but rather an external (container or caller) 'injects' the dependencies at creation time. The object only declares the required interfaces, and the concrete instances are determined externally, thereby reducing coupling and improving testability and replaceability.

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/Dependency_injectionZH · Explicit
    verified

RELATED MODELS