Skip to content

Functional bean dependencies tracking [SPR-15417] #19979

Closed

Description

@spring-projects-issues

Sébastien Deleuze opened SPR-15417 and commented

The new functional bean registration mechanism gets the type of the bean to register (via an explicit class parameter in Java or via reified type parameters in Kotlin) but unlike JavaConfig which declare explicitly bean dependencies as input @Bean method parameters, the functional variant don't know what bean dependency are needed because it is based on opaque applicationContext.getBean() invocations performed by the Supplier implementation.

Tracking those applicationContext.getBean() invocations would allow the functional bean registration mechanism to build the same kind of bean dependency graph than with JavaConfig, allowing to cover the same use cases and improving consistency between both approaches.


Issue Links:

Activity

  1. spring-projects-issues commented on Apr 7, 2017

    @spring-projects-issues
    CollaboratorAuthor

    Juergen Hoeller commented

    I've implemented this through implicit tracking of all bean retrieval operations, effectively triggering a registerDependentBean call for every getBean etc operation from a Supplier callback.

  2. added
    type: enhancement
    in: core
    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: coretype: enhancement

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions