Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expected ConfigAbstractFactory configuration per service manager #15

Closed
weierophinney opened this issue Dec 31, 2019 · 2 comments
Closed

Comments

@weierophinney
Copy link
Member

I find the new Config Abstract Factory very handy. That saves a lot of typing. So thanks for that 👏.

One thing that keeps bothering me however is that there seems to be only a single configuration array that determinates how services in all service manager are to be instantiated. You can mix plain services, controllers and view helpers!

IMO that:

  • Introduces some possible problems if service names are identical.
  • Disallows one to properly split the configuration per service manager. When you have a lot of services it really helps to categorize them.

Another way of tackling this would be to add the config key directly as one of the components of the service manager config. But there are obviously other options.

return [
    'factories => [],
    \Zend\ServiceManager\AbstractFactory\ConfigAbstractFactory::class => []
];

I am curious what other people think; or how they tackle this problem?


Originally posted by @roelvanduijnhoven at zendframework/zend-servicemanager#212

@GeeH
Copy link
Contributor

GeeH commented Jun 8, 2020

I'm closing this, it was a question rather than issue from over 3 years ago, I hope the OP found the resolution they needed!

@GeeH GeeH closed this as completed Jun 8, 2020
@roelvanduijnhoven
Copy link

@GeeH OP is satisfied ;) and dit not use ConfigAbstractFactory in a long time: ReflectionBasedAbstractFactory FTW!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants