-
Notifications
You must be signed in to change notification settings - Fork 38.6k
Closed
Closed
Copy link
Labels
in: coreIssues in core modules (aop, beans, core, context, expression)Issues in core modules (aop, beans, core, context, expression)type: enhancementA general enhancementA general enhancement
Milestone
Description
If initializing bean via constructor dependency injection, Spring will do the candidates look-up by parameter type (essentially via BeanFactoryUtils#beanNamesForTypeIncludingAncestors
) which is really slow if application getting huge. We are searching an approach to tell Spring to look-up candidates by constructor's parameter name.
I've read the code in ConstructorResolver
but cannot find a way to achieve constructor dependency injection by parameter name. By the way there is a similar question on Stack Overflow: Spring autowire by name constructor arguments, there is just a work-around but not solution.
Can Spring support this feature if parameter name is available in runtime?
Affects: <All Spring Framework versions>
Metadata
Metadata
Labels
in: coreIssues in core modules (aop, beans, core, context, expression)Issues in core modules (aop, beans, core, context, expression)type: enhancementA general enhancementA general enhancement