Showing differences between Dependency Injection and Service Locator (factory container)
- Only defined services (Just knows about what it's told to know about)
- Have to configure everything manually
- Inspects constructor of classes in order to inject new instances of required parameters
- Uses Reflection to do this at the time the item is requested
- Show initial Service Locator Container Bootstrap
- Weep at the amount of work just to instantiate a single complex object :(
- Run
run-sl
- Show DI Container Bootstrap
- Totes Amazeballs - its so simple!
- Obviously need to write more code, no?
- Run
run-di
- Profit
- Coding time!
- More coding
- So much more coding