I\'m going trough ZfcUser to learn more about modules in Zend Framework 2. In the Module.php you can see
\'invokables\' => array(
\'ZfcUser\\Authentication\
There is no convention but I do think you should consider how the invokables will be used.
For example the first three rely on an interface called ServiceManagerAwareInterface
therefore these instances need to come out of the ServiceLocator
to function as intended. Given that they are fully qualified class names, I would assume that the ZfcUser developers do not envisage people overriding these.
And the latter two are aliased, so if a developer wanted to override these invokables it would be a straightforward task. An example of this is the developer chooses to extend ZfcUser\Service\User
to add/modify functionality, then creates line in his module's invokables:
'invokables' => array(
'zfcuser_user_service' => 'MyModule\Service\ZfcUser',
),
Then any code using zfcuser_user_service
would receive an instance of MyModule\Service\ZfcUser
rather than ZfcUser\Service\User
.