Slaying Sacred Cows: Deconstructing Dependency Injection
summary
Argues that dependency injection frameworks like Spring or Guice add little value beyond plain constructor injection, showing Java examples and a toy service wired two ways (manual vs Guice) where wiring is only ~50–100 lines for a 20–50 component app. Claims IOC containers slow startup, reduce discoverability, and promote deconstructive testing that mocks large graphs instead of focused units. Notes one exception: very large monoliths (hundreds of components) may trade coherence for easier team scaling, but recommends breaking systems down instead.
AI-written summary · about
chapters (9)
- 0:00Introduction and semantics
- 4:02Dependency inversion
- 8:18Defining dependency injection
- 11:33Inversion of control
- 15:19Justification of DI frameworks
- 18:53Critique of automatic wiring
- 24:05Testing anti-patterns
- 33:50Audience Q&A
- 38:41Conclusion and takeaways
related talks
49mSpring, Jakarta EE, CDI and Other Pathologies
40mFundamentals of Dependency Injection
49mReaders vs Constructors: Dependency Injection showdown
34mJava Modules meet Dependency Injection
01h 29mDependency Injection in C++ - A Practical Guide
32mLet's Build a Dependency Injection Framework
41mIoC containers beyond constructor injection
01h 00mFantastic Frameworks and How to Avoid Them
