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

Closed
spring-issuemaster opened this issue Apr 1, 2011 · 2 comments

Comments

@spring-issuemaster
Copy link
Collaborator

commented Apr 1, 2011

Chris Beams opened SPR-8148 and commented


Reference URL: http://forum.springsource.org/showthread.php?110704-Spring-AOP-in-Java-Config&p=367069

Issue Links:

  • INT-3329 Provide the JavaConfig analogue
@spring-issuemaster

This comment has been minimized.

Copy link
Collaborator Author

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.

See http://static.springsource.org/spring/docs/3.1.0.M2/spring-framework-reference/html/aop.html#aop-ataspectj

@spring-issuemaster

This comment has been minimized.

Copy link
Collaborator Author

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
Projects
None yet
1 participant
You can’t perform that action at this time.