Skip to content

An ObjectFactory variant with lenient not-unique handling [SPR-13943] #18515

Closed
@spring-projects-issues

Description

@spring-projects-issues

Stéphane Nicoll opened SPR-13943 and commented

In Spring Boot it is very common to associate a bean to something if it is found in the context. If there is more than one instance but one is flagged as primary then we're fine as well. If there are more than one instance and the user did not mark a preference for one, then we don't know which one to use.

We would need a first class support of that use case, maybe based on the ObjectFactory. Something that would return the candidate bean or null if none was found.


Issue Links:

Referenced from: commits ed98393, 343bb2f

Metadata

Metadata

Assignees

Labels

in: coreIssues in core modules (aop, beans, core, context, expression)type: enhancementA general enhancement

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions