The IoC Hydra
summary
IoC is broader than DI and has three practical forms: DI, AOP and events. Containers excel at resolving huge object graphs but many bundles and config files slow compilation — one real project produces an 8MB container PHP file — so splitting kernels for API and UI speeds cold builds. Avoid service-locator and setter injection; prefer constructor injection with a null object for optional deps. EventDispatcher is a mediator (mutable events create hidden coupling). Note prototype scope removed in Symfony 3.0.
AI-written summary · about
chapters (23)
- 0:00Intro
- 2:37PROS
- 3:39CONS
- 5:39EXAMPLE WITH EVENTS
- 7:36EXAMPLE WITH AOP USING DECORATOR
- 10:54RESOLVING GRAPHS OF OBJECTS
- 11:58LIFECYCLE MANAGEMENT
- 12:19SERVICE LOCATOR
- 15:04SETTER INJECTION
- 16:46FUNCTIONAL WAY OF DOING THINGS
- 18:04FEATURES
- 18:29PERFORMANCE OF SYMFONY DIC
- 19:22SLOW COMPILATION
- 20:57LARGE CONTAINERS
- 21:44PRIVATE SERVICES
- 23:35INJECTING CONTAINER DIRECTLY
- 24:23USING PROXY OBJECTS
- 25:11DEFINING CLASS NAMES AS PARAMETERS
- 29:23PROBLEMS WITH INJECTING REQUEST TO SERVICES
- 31:14STATEFUL SERVICES
- 33:19EXTENDING BASE CONTROLLER
- 34:54CONTROLLER AS A SERVICE
- 38:10INDIRECT COUPLING PROBLEM
