← Graph

Dependency Injection

concept 12 connections

Technique for decreasing coupling by configuring an object's collaborators from the outside. Szydło reframes dependency injection as 'configurable instance' coupling: the caller holds a reference to an interface (a dispatch point) rather than a concrete class, so any implementation can be plugged in. Metaphor: calling a call-center dispatch instead of a specific person. Comes at the cost of added complexity — worth paying only where configurability is actually needed. Bicycle analogy: everything except the frame is configurable (wheels, steering), trading simplicity for flexibility.

category
pattern
about
Dependency Injection concept
Reframed as the 'configurable instance' level of coupling.
about
Dependency Injection concept
Injecting a FakeDice into Game is presented as the clean solution, and DI is named explicitly at the end of that section.
about
Dependency Injection concept
Recommendation is a direct application of DI to testing.
about
Dependency Injection concept
Proposes DI of a current-time object as an alternative to time-travel helpers.
about
Dependency Injection concept
Takes a position on how dependency configuration should be done — inside the class, not via external frameworks.
about
Dependency Injection concept
The question challenges whether external configuration is equivalent to in-class dependency wiring.
about
Dependency Injection concept
Answer discusses whether DI applies in this architecture.
about
Dependency Injection concept
Promotes Spree's built-in dependency-injection system as the replacement for monkey patching.
about
Dependency Injection concept
The takeaway's prescription is to expose behavior via DI-configurable service objects.
about
Dependency Injection concept
Answer proposes shipping two DI-configurable strategies.
recommends
Dependency Injection concept
Advocates replacing monkey patches with dependency-injected service objects.
concept Dependency Injection
related_to
Coupling concept
DI corresponds to the 'configurable instance' level of coupling.

Provenance

Read by
15 extractions