Skip to content

Document common use cases for @Order vs @Priority vs @DependsOn [SPR-16213] #20761

Closed
@spring-projects-issues

Description

@spring-projects-issues

Phil Webb opened SPR-16213 and commented

It wasn't immediately obvious to me that @Order can be used on @Bean methods to change the order of Collection<BeanType> injection.

Some dedicated section of the reference documentation explaining @Order and the difference between @DependsOn could be useful. It might also be worth adding a note to the Javadoc (although technically @Order is in core so it shouldn't know about context concerns).

Here's an example stack overflow question with someone else asking the question and a slightly misleading answer:
https://stackoverflow.com/questions/36187063/instantiate-beans-in-order-in-spring


Issue Links:

Referenced from: commits 84699c8, 1d060ec

Backported to: 4.3.13

Metadata

Metadata

Assignees

Labels

in: coreIssues in core modules (aop, beans, core, context, expression)status: backportedAn issue that has been backported to maintenance branchestype: taskA general task

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions