Slaying Sacred Cows: Deconstructing Dependency Injection
summary
Argues that dependency injection as implemented by Spring/Guice/Angular is often unnecessary and harmful: manual constructor wiring (new + constructors) matches container wiring but remains simpler, while runtime reflection and classpath scanning increase startup time, obscure origins of dependencies, and delay errors until runtime. Claims testing with containers produces deconstructive testing full of incidental mocks and brittle setup. Concludes IoC containers only buy a tradeoff for very large legacy monoliths and that Dagger2 is a rare compile‑time exception.
AI-written summary · about
chapters (12)
- 0:00Introduction to talk
- 1:05Why this talk exists
- 2:49Dependency inversion basics
- 7:28Dependency injection explained
- 11:02DI vs inversion of control
- 15:57Why use DI containers
- 19:10Wiring components comparison
- 25:08Testing with DI containers
- 31:10IOC as a solution in search
- 38:15When IOC is valid concern
- 42:09Conclusion and opinions
- 43:35Q&A on testing and IOC
