Compared to more traditional patterns, the Service Locator pattern has less academic theory behind it and is very pragmatic in its overall design. As its name implies, its purpose is to locate services for a client. It achieves this by maintaining a central registry of objects that offer specific services.
Let's review a diagram of a typical Service Locator implementation:
As we can see, we could easily say that the Service Locator pattern is acting as a proxy between the clients (requestors) and the service providers, and this approach decouples them to a certain degree. A client will only need to call the Service Locator pattern when it has a dependency to resolve and needs access to a service. We could say that the Service Locator pattern is acting similarly to a waiter in a restaurant, taking orders from clients and acting as an intermediary between...