Skip to content
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

Introduce @Configuration-based equivalent to aop:config XML element [SPR-8148] #12799

spring-projects-issues opened this issue Apr 1, 2011 · 2 comments


Copy link

@spring-projects-issues spring-projects-issues commented Apr 1, 2011

Chris Beams opened SPR-8148 and commented

Reference URL:

Issue Links:

  • INT-3329 Provide the JavaConfig analogue
Copy link
Collaborator Author

@spring-projects-issues spring-projects-issues commented Jun 15, 2011

Chris Beams commented

The @Aspect model in AspectJ is designed for pure-Java configuration, and should be used in favor of aop:config when looking to create 100% java-based configuration using Spring's @Configuration model.

aop:config cannot properly be translated into the @Configuration model, largely because Java does not support method literals in the language. This leaves us resorting to String-based references to methods, which is not ideal.

So the approach that users should consider are:

  1. Continue using aop:config by including the relevant XML snippet using @ImportResource

  2. Convert any existing aop:config elmements to use @Aspect style.


Copy link
Collaborator Author

@spring-projects-issues spring-projects-issues commented Aug 5, 2013

Eberhard Wolff commented

I guess you are referring to an aop:aspect element in an aop:config element. I agree that this does not make a lot of sense. However, aop:advisor could be supported without the problem concerning string referencing methods. And this element is quite important e.g. for the advices in org.springframework.aop.interceptor as well as Spring's transaction support. Can you reconsider to support at least aop:advisor using an annotation based model? For the other cases I am not really following either (but I don't care that much) - the XML configuration also uses Strings to reference methods. So I don't see an issue doing the same with Java.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant