The container registers your dependencies and can resolve them. The locator, on the other hand, uses the container to enable services.
To be able to use the container, you must have a link to it. On the other hand, the locator is usually available statically, you do not need a link to it.
A locator is considered an antipatter only because it allows you to resolve any dependency "in place" that actually makes implicit dependencies. This means that the class client is not aware of the dependency until it appears at run time.
source share