|
Spring 2.x - innovation or maturity?
[
avasseur
]
Last week I had the pleasure to discuss some more with the Spring team at JavaPolis, and I was thus given a quick informal update on what they are heading at in Spring 2.x, especially on the AOP side, discussing with Rod and Rob. Spring AOP in Spring 1.x has been easy to use - though missing a good pointcut language. This simplicity is well described in a recent article on dev2dev by Eugene, and I had debated this issue and tried to solve it with Spring pointcuts on steroids with AspectWerkz. In Spring 2.x, with the help of newly appointed excellent Adrian Coyler as chief scientist, my AspectJ lead peer, Spring AOP will unleash AspectJ and @AspectJ that I spent quite some time on this year as per our engagement to merge best of breed AspectWerkz with AspectJ. But going beyond, Spring 2.x also introduces a way to define aspects in your spring bean xml files directly f.e.: <aop:aspect id="countAgeCalls" ref="countingAdvice"> <aop:pointcut id="setCalls" expression="execution(* *..ITestBean.set*(..))"/> <aop:advice pointcut="execution(* *..ITestBean.set*(..))" method="myBeforeAdvice" kind="before"/> <aop:advice pointcut-ref="setCalls" method="myAfterAdvice" kind="after"/> <aop:advice pointcut-ref="setCalls" method="myAroundAdvice" kind="around"/> </aop:aspect> This is actually a really nice feature that I started playing with 2 years ago when implementing AspectWerkz with Jonas. So there is not much innovation there. There might actually be some issues and hard work going forward. By having aspects defined this way, the AspectJ runtime that is used when your are using the excellent AJDT Eclipse Plugin for AspectJ will not take those into account (whilst regular @AspectJ ones are fully supported). This means there 'll be definitely a need to open-up some more AJDT and have some extension point in it so that the Spring IDE can leverage it and have the AJDT crosscutting view display the Spring xml defined aspect. Wups - xml defined aspect I have said - just like this June 2003' Jonas article introduces, back in AspectWerkz 0.6.3 Maturity - finally! "Wups - xml defined aspect I have said - just like this June 2003' Jonas article introduces, back in AspectWerkz 0.6.3" ...those were days...brings tears to my eyes ;-) Fun to look back and see that we, at least *in some ways* actually set up the directions for future... * XML defined aspects (On the other hand, we stole a lot from AJ :-) ) --Jonas, December 23, 2005 02:03 PM
What I always liked about Spring AOP is that it least intrusive and does not require any precompilation steps even so it is definetely less powerful and flexible then AspectWerkz or AspectJ. So, we can basically deploy it right with anything including EJB components and I can't resist to give a link to my article on the topic. :-) --eu, December 23, 2005 07:31 PM
It's good to see Spring 2.0 really smoothing the incremental adoption of aspects from pure proxy up to full weaving. It's been a productive fusion of good ideas from many sources. I was encouraged to hear Roberto Chinnici of Sun talk about proxy-based AOP as a promising future for J2EE... Yet another step towards maturity. And as your next post mentions Alex, Microsoft looks to be taking AOP more seriously. I think that could also be motivating to Sun to look more seriously at integrating AOP support into Java (at least into the VM). I personally am still not a fan of XML-defined code like this (that's why I originally suggested annotation-based aspects for cases where you can't have true code). --Ron Bodkin, January 6, 2006 09:05 AM
Post a comment
|