user3511397on Stack Overflow • Recommends
On “Is ServiceLocator an anti-pattern?”
From the testing point of view, Service Locator is bad. See Misko Hevery's Google Tech Talk nice explanation with code examples link to this video starting at minute 8:45. I liked his analogy: if you need $25, ask directly for money rather than giving your wallet from where money will be taken. He also compares Service Locator with a haystack that has the needle you need and knows how to retrieve it. Classes using Service Locator are hard to reuse because of it.