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

Injector enforces consistency during add or removal, but how to allow replacing? #3

Open
hjohn opened this issue May 12, 2022 · 0 comments

Comments

@hjohn
Copy link
Owner

hjohn commented May 12, 2022

Currently there is no way to replace a type with another type if this type is currently used as a dependency. Adding a replacement would lead to an AmbiguousRequiredDependencyException while first removing the existing type would lead to an UnsatisfiedRequiredDependencyException. It should not be impossible to allow for an addition and removal simultaneously with the end result still satisfying all required dependencies.

This may have a use case during testing where a registered bean may be replaced completely with a mock.

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