DEV Community

Discussion on: Demystifying Dependency Injection, Inversion of Control, Service Containers and Service Providers

Collapse
 
juliang profile image
Julian Garamendy

This is a very good article. It does a great job at explaining a service locator implementation.

However, I'm of the following opinion:

"the problem with Service Locator is that it hides a class' dependencies, causing run-time errors instead of compile-time errors, as well as making the code more difficult to maintain because it becomes unclear when you would be introducing a breaking change."

blog.ploeh.dk/2010/02/03/ServiceLo...