The 7 Deadly Sins of Dependency Injection
summary
Clears specific mistakes: using a service locator or container‑aware objects hides real dependencies, property injection uses reflection and is slow and brittle, and constructors with many args mean bad architecture not DI failure. Gives numbers and history: company converted its framework to DI in 2005 and ran ~200 projects, a Composer search returns 285 packages for DI, and two contributors start container-interop on GitHub. Recommends Constructor injection, interfaces over concrete classes, factories for default wiring, PHP config for speed, and prefers Symfony’s container.
AI-written summary · about
chapters (43)
- 0:00Start
- 3:47The 7 deadly sins
- 3:58Lust
- 4:19A simple controller...
- 5:41Can a Service Locator help?
- 8:39Avoid "ContainerAware"
- 9:07Establish boundaries
- 9:50Greedy controllers...
- 11:49Architecture is tool agnostic
- 12:33ServiceLocator will not fix it
- 12:57Depend on what you need...
- 13:30Dependency Inversion
- 13:50Depend on abstractions
- 14:48Gluttony
- 15:13Too many implementations
- 16:46No common standard!
- 17:00I have a dream
- 18:29Sloth
- 18:48(Public) Property injection
- 20:01(Protected) Property injection
- 22:25Constructor injection
- 25:37Null checks everywhere!
- 26:38Circular dependency hell
- 27:06Avoid circular dependencies!
- 27:16Interface injection
- 28:17Implicit wiring
- 29:12Default dependencies?
- 30:30Separating the concerns
- 32:29Wrath
- 32:58DIC vs. SL
- 35:31Using a DIC
- 36:01Envy
- 36:22Types of configuration
- 36:49Internal Configuration
- 39:34External Configuration
- 41:42Both ways make sense...
- 42:03pick what makes sense!
- 42:51Configuration is too complex?
- 44:11Pride
- 44:33Choose wisely
- 45:38Learn to love it
- 46:03Famous final words
- 56:31Artwork credits
related talks
01h 19mDependency Injection: Theory and Practice
01h 00mHow to Use Dependency Injection to Write Maintainable Software
33mDI: DIY
39mDeep DI-ving: how Angular's DI system defeated a monolith
58mGetting a grip on your code dependencies
01h 00mThe many meaning of Inversion of Control
44mDependencies; Devil or Darling?
03mLightning Talk: Dependency Injection for Modern C++
