-
Notifications
You must be signed in to change notification settings - Fork 2.5k
[Navigation] Introducing NavigationAbstractServiceFactory #7245
[Navigation] Introducing NavigationAbstractServiceFactory #7245
Conversation
I think |
|
We can worry about that in a month or two. :) |
…factory [Navigation] Introducing NavigationAbstractServiceFactory
@sandrokeil |
I will do it in the next few days. |
…avigation-abstract-service-factory [Navigation] Introducing NavigationAbstractServiceFactory
Developer can't inherit due to its final behavior. Can anyone please explain why this factory using "final" keyword at class declaration? |
@razonklnbd Why do you want to inherit from this class, it's not necessary. Please consider to create your own factory for your special behaviour. A good explanation when to use final, can be found here. That's the case. |
@sandrokeil Thanks for your explanation. |
According to the feedback of #6717 I've created the Navigation Abstract Service Factory. If this abstract service factory is registered, a service with name
Zend\Navigation\Special
will use thespecial
definition in configuration keynavigation
.With one point I'm not satisfied. A service call must start with
Zend\Navigation\
(e.g.$sl->get('Zend\Navigation\Special')
). Maybe we could supportnavigation.special
too?I use the
ConstructedNavigationFactory
to create the Navigation Container. Is this ok or should I use theAbstractNavigationFactory
(@weierophinney)? The problem here is that we have to implement the getName() and override the getPages() method. For the future (ZF 3.0) we could remove getName() and make getPages() abstract inAbstractNavigationFactory
. This makesDefaultNavigationFactory
andConstructedNavigationFactory
needless. But it's a BC break.I will also update the documentation.