PDA

View Full Version : AspectJ against SpringAOP



obrand
Sep 2nd, 2007, 06:22 PM
I need to create an Around advice in my Spring based project. Would you recommend to use the SpringAOP + aopalliance implementation or the AspectJ one?
I have also noticed in the Spring documentation that AspectJ is more or less used across all examples. Does it mean that AspectJ should be used instead of Spring AOP?

Thanks

Olivier

gregturn
Sep 3rd, 2007, 10:37 AM
Spring 2.0's AOP solution now supports using AspectJ's pointcut language, even thought it is still providing proxies. That may be confusing you. I would only use AspectJ if Spring AOP doesn't cut it for your solution, or perhaps you are more interested in it. AspectJ still requires installing the special compiler/runner to handle load time weaving. Spring AOP is simpler to use, and only requires you install the appropriate jar files with your app. If that is good enough, I say go for it.