Computing Atlas

How Computing Was Built
Sign In
Text size
100%
Theme
Concept

Dependency Injection

Technique

A technique in which an object's dependencies are supplied to it from outside rather than being constructed by the object itself, making code easier to test and to reconfigure since a dependency can be swapped without changing the dependent class.

Facts
Core Principle
An object or function receives the other objects or functions it requires rather than creating them internally. 1
Connections

In Field

Invented

Martin Fowler coined and formalized the term dependency injection in his widely cited 2004 article distinguishing it from the broader inversion-of-control principle.

Sources
1. Dependency injection - Wikipedia
Lead paragraph
Quote, Lead paragraph
Dependency injection is a programming technique in which an object or function receives other objects or functions that it requires, as opposed to creating them internally.
View the Source
Comments (0)
No comments yet. Be the first to share a thought.
Reader Challenges (0)
No disputes yet. Spotted an error or a better source? Open the first one.