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

General improvement of the API when it comes to factories #20

Closed
svermeulen opened this issue Sep 23, 2014 · 2 comments
Closed

General improvement of the API when it comes to factories #20

svermeulen opened this issue Sep 23, 2014 · 2 comments

Comments

@svermeulen
Copy link

Currently, we have two factory implementations: IFactory/Factory and FactoryTyped. FactoryTyped is the preferable approach, since it is strongly typed (unlike IFactory) and is also automatically validated (an example can be found here). It should therefore probably become the standard factory class so we may want to rename it to just Factory during the next breaking version update

Both approaches have the issue that null arguments result in an exception being thrown. This is because both approaches rely on the type information to figure out which field/parameter to inject into. This is problematic when you actually do want to inject a null value so we need to address that. It is also an issue when you want to inject multiple instances of the same type into a class via factory arguments.

So I think we may want to use the ordering information provided to the factories to handle these cases.

@svermeulen
Copy link
Author

This issue has been addressed in the develop branch, which will be merged in when stable

@svermeulen
Copy link
Author

Fixed on master and documentation updated.

monry pushed a commit to monry/Zenject that referenced this issue Aug 7, 2019
…rojectContext to be static so they can be accessed without triggering ProjectContext to start (issue ssannandeji#20)
weiping-playnext pushed a commit to Wonderplanet/Zenject that referenced this issue Mar 11, 2021
…rojectContext to be static so they can be accessed without triggering ProjectContext to start (issue ssannandeji#20)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant