Skip to content

Investigate ScopedProxyBeanDefinitionDecorator (aop:scoped-proxy) [SPR-8171] #12822

Closed

Description

@spring-projects-issues

Chris Beams opened SPR-8171 and commented

This one is particularly sticky. aop:scoped-proxy is the one and only BeanDefinitionDecorator in existence, so there's no precedent for supporting such a beast with the FeatureSpecification model.

Nor necessarily should there be. Much like <context:spring-configured/>, this is likely a 'feature' that should take a different form when it comes to actual configuration. Just brainstorming, a @ScopedProxy annotation may be appropriate, perhaps at the parameter level on @Bean methods dependent on the object to be proxied:

@Bean
@Scope("session")
public UserPrefs userPrefs() {
   return ...;
}

@Bean
public FooController fooController(@ScopedProxy UserPrefs userPrefs) {

}

Such an approach would resolve an often-mentioned claim that <aop:scoped-proxy/>) being declared on the scoped bean itself is the wrong location - that it should be inverted, such that the caller asks for the proxy only if needed. The exact approach above would suffer from the inability to call (inject) @Bean methods that accept parameters, but that's digressing a bit at this stage.


This issue is a sub-task of #12694

Activity

  1. spring-projects-issues commented on Dec 6, 2011

    @spring-projects-issues
    CollaboratorAuthor

    Chris Beams commented

    Bulk "Won't Fix" resolution of remaining FeatureSpecification-related issues. These types were backed out in Spring 3.1 M2 in favor of @Enable* annotations and other mechanisms.

  2. added
    status: declined
    type: task
    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

No one assigned

    Labels

    status: declinedtype: task

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions