Hello Automatix,

Locations that I found to be legit use-case scenarios for the
ServiceLocator are:

 - factories
 - abstract factories
 - any kind of lookup map, such as:
    * a connection pool
    * map from name to service (such as in the DispatchListener in ZF2)

Basically, it drills down to either scrap code or code that is actually
doing some "location" job.

Marco Pivetta

http://twitter.com/Ocramius

http://ocramius.github.com/

On 5 August 2015 at 10:52, automatix <i...@automatix.info> wrote:

> Hello Community!As is generally known injecting the ServiceManager as
> dependency is a bad practice. Nonetheless -- are there
> compromises/exceptions, where it would be acceptable in your opinion? Is a
> Factory for example such a case:vs.Thanks & regards,Ilya
>
>
>
> --
> View this message in context:
> http://zend-framework-community.634137.n4.nabble.com/In-what-case-Can-a-ServiceManager-Injection-be-warrantable-tp4662642.html
> Sent from the Zend Framework mailing list archive at Nabble.com.

Reply via email to