From: Adrian C. <ad...@as...> - 2006-01-31 13:29:46
|
Hi Renaud, I took a quick look at the Spoon-AOP page (haven't had a chance to dig into spoon itself yet). Your comment on the AspectJ performance is a little misleading. AspectJ will optimize any use of thisJoinPoint that uses only the "thisJoinPointStaticPart" of the JoinPoint interface. "thisJoinPoint.getArgs()" falls out of that contract, because it returns the actual argument array. The statically knowable subset of join point information can be no different between Spoon-AOP and AspectJ (or any other Java-based AOP implementation). In AspectJ you can: * implement the example much more efficiently using a pointcut: before() : execution(* ToBeAdvised.*(*,..)) { ... } * in general, bind the contextual information you need explicitly, giving you typed advice and no overhead * use thisJoinPointStaticPart (or the static parts of thisJoinPoint, which will be optimised to give the same result) * only use the full thisJoinPoint object when you really need runtime access to the actual this, target, and args objects (and then there are lazyTjp optimizations that will also kick in) The JoinPoint implementation is also not based on java.lang.reflect under the covers (you state otherwise). In what way do you believe Spoon-AOP is "better typed" than most of the classical AOP approaches? Can you give an example where Spoon-AOP has stronger typing than an equivalent AspectJ program? Renaud Pawlak wrote: > > Dear all, > > It is my pleasure to announce here the first release of Spoon: a > powerful Java 5 annotation processing tool. > > It is available in Open Source at http://spoon.gforge.inria.fr/ > > Spoon is similar to APT > (http://java.sun.com/j2se/1.5.0/docs/guide/apt/GettingStarted.html) > except that it provides a full metamodel of Java 5 (also models the > Java code in the method bodies) and that it implements compile-time > reflection. So, Spoon can be used for more in-depth and fine-grained > program transformation and analysis. > > In addition, for specifying the transformations, Spoon allows the use > of pure-Java templates (which can be compared to Velocity templates > except that they are written in Java and, as such, directly benefit > the IDE support for type soundness, navigation, and other features). > > Finally, let me point out for you a small application of Spoon: an > original and efficient annotation-driven AOP weaver called "Spoon-AOP" > available at http://www.lifl.fr/~pawlak/spoon-aop/ > > Enjoy! > /Renaud > |