Skip to content

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

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

Closed
spring-projects-issues opened this issue Nov 18, 2017 · 0 comments
Assignees
Labels
in: core Issues in core modules (aop, beans, core, context, expression) status: backported An issue that has been backported to maintenance branches type: task A general task
Milestone

Comments

@spring-projects-issues
Copy link
Collaborator

spring-projects-issues commented Nov 18, 2017

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: core Issues in core modules (aop, beans, core, context, expression) status: backported An issue that has been backported to maintenance branches type: task A general task
Projects
None yet
Development

No branches or pull requests

2 participants