[fw-general] (In what case) Can a ServiceManager Injection be warrantable?

2015-08-05 Thread automatix
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:

[fw-general] Re: (In what case) Can a ServiceManager Injection be warrantable?

2015-08-05 Thread automatix
The example was incorect, here is a patch: vs. -- View this message in context: http://zend-framework-community.634137.n4.nabble.com/In-what-case-Can-a-ServiceManager-Injection-be-warrantable-tp4662642p4662643.html Sent from the Zend Framework mailing list archive at Nabble.com. --

Re: [fw-general] (In what case) Can a ServiceManager Injection be warrantable?

2015-08-05 Thread Marco Pivetta
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