Hi Daniel,

> Am I correct in thinking that if I have a ServiceManager defined with
> anonymous functions like so: (Added to 'factories' configuration key)
> 
> ...
> 
> it will be called upon every request?

The closure will only be called when the controller "Foo" is actually
requested. But the function itself is loaded every time.

> As opposed to defining a factory class:
> 
> 'Album\Controller\Foo' => 'Album\Service\FooControllerFactory'
> 
> Which will be called when we use the service key:  'Album\Controller\Foo'

The factory will actually just be loaded when the controller is
requested. So it makes more sense to really define all factories as
classes, instead of closures. Closures are just great for rapid prototyping.

-- 
Ben Scholzen 'DASPRiD'
Community Review Team Member | [email protected]
Zend Framework               | http://www.dasprids.de

-- 
List: [email protected]
Info: http://framework.zend.com/archives
Unsubscribe: [email protected]


Reply via email to