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

Factory arguments #15

Closed
mnapoli opened this issue Nov 28, 2015 · 4 comments
Closed

Factory arguments #15

mnapoli opened this issue Nov 28, 2015 · 4 comments

Comments

@mnapoli
Copy link
Member

mnapoli commented Nov 28, 2015

At some point, we said that factories should take the requested ID as the only argument.

Then later we forgot about that (it wasn't enforced or documented in the interfaces) and we allowed factories to take arguments (just like any method call).

Which one should we support? We need to fix that, see also mnapoli/assembly#7

@mnapoli
Copy link
Member Author

mnapoli commented Nov 28, 2015

FYI:

@Anahkiasen
Copy link

For me the second option is far more flexible. First option would force you to write factories for every service you write a definition for, while second option would technically allow you to to write factory definitions for classes that weren't made with definition-interop in mind.

@moufmouf
Copy link
Contributor

Completely agree with Maxime. 2nd option is the way to go.

This also highlights the interest of having a set of abstract unit tests that can be used by any container to test if it is definition-interop compliant. I might take a look at this topic next week if I find some time.

@mnapoli
Copy link
Member Author

mnapoli commented Nov 28, 2015

That means though that we cannot use abstract factories, i.e. use one factory to create several services. But I agree with you that the second option is much more important than the first one, especially if the goal is to provide a simple implementation (not covering all use cases).

Then I guess we can close this one and only mnapoli/assembly#7 needs fixing.

@mnapoli mnapoli closed this as completed Nov 28, 2015
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