Skip to content

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

@hjohn

Description

@hjohn

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.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions