Skip to content

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

Closed

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

Activity

  1. added
    status: backported
    in: core
    type: task
    on Jan 11, 2019
  2. added this to the 5.0.2 milestone on Jan 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

in: corestatus: backportedtype: task

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions