« Joining Interface21 | Main | AspectJ 1.5.0 is here at last! »

December 15, 2005

Lots of new toys...

AspectJ 5 RC1, AJDT 1.2.1 RC1, and AJDT 1.3.0 RC1

It's been a really busy last few weeks for me. Yesterday we finally made it to RC1 of AspectJ 5 (a release that has been a long time coming). This enabled AJDT to also put out RC1 releases for Eclipse 3.0 and 3.1. From a purely technical perspective, AspectJ 5 has been the hardest (and most technically interesting) thing that I've worked on in my career to date. It's a full update to the AspectJ language for Java 5 (but it also has lots of improvements over 1.2.1 for folks on JDK 1.4 or 1.3 as well). The edited highlights of the release include:

  • Full generics support in pointcuts and inter-type declarations
  • Generic aspects (this is a really cool language feature that opens up a lot of possibilities - I'll write more about this and the other features over the next few weeks). My favourite quote from Andy (Clement) on this one... "implementing generic aspects is rocket science" :)
  • Full support for varargs, autoboxing, and covariance in pointcut expressions and join point matching
  • A new aspect instantiation model, pertypewithin
  • A whole new syntax, the "@AspectJ" annotation-based syntax for those stuck with tools that can't cope with the AspectJ keywords (are you reading Rob? ;) )
  • Dramatically improved load-time weaving support
  • A full reflection API, the AjTypeSystem - it's like the java.lang.reflect package but understands the AspectJ type system and can give details of pointcuts, advice, itds, and so on as well as methods and fields etc..
  • A weaver tools API, that amongst other things, opens up the AspectJ pointcut parsing and matching engine for third-party integration. We exploit this to good effect in...

Spring 2.0 M1

Last week was The Spring Experience conference in Miami. What a great event and an amazing atmosphere - it really was something to be part of. We used the event to announce and release Spring 2.0 M1 (we also used the days right before the conference to finish 2.0 M1 - no trips to the beach for I21!). Spring 2.0 has significantly improved ease-of-use for AOP, and is much more powerful at the same time thanks to much closer integration with AspectJ.

The news of Spring 2.0 has spawned two of the most active threads on TSS in a long time:

Here's a summary of the Spring 2.0 AOP enhancements - there's much more to write about all this soon...

  • Spring AOP is remaining as a proxy-based framework offering the ability to advise bean method execution. The facilities that Spring AOP offers are complementary to AspectJ in that they offer runtime control of advice on a per-instance basis, for beans managed by the Spring container.
  • The configuration of Spring AOP is dramatically simplified in Spring 2.0 using the new XML schema support. Configuration of transactions is simplified even further. Spring 2.0 remains fully backwards compatible of course.
  • Spring 2.0 adds the ability to use the AspectJ 5 pointcut language when configuring Spring advisors and aspects (you can write an AspectJ pointcut expression directly in the xml file). This still uses the Spring AOP proxy framework (not AspectJ) to implement the advice behaviour, but it uses AspectJ 5 to parse and match the pointcut expressions. This gives Spring users the option to use a powerful and flexible pointcut language (that understands generics, varargs, covariance, annotations, and so on) that works consistently across both Spring and AspectJ. It also means that Spring pointcut expressions can refer to pointcuts in compiled AspectJ libraries when using Spring and AspectJ together.
  • Spring 2.0 adds support for @AspectJ aspects (aspects written using the AspectJ 5 annotations such as @Aspect). If you have an @AspectJ style aspect, Spring can support it using the Spring AOP framework. You then have the choice to seamlessly switch from Spring AOP to AspectJ based weaving if you find you need greater performance or features that go beyond the capabilities of the Spring AOP framework.
  • Spring 2.0 ships with a new jar, spring-aspects.jar, which will contain a number of AspectJ aspects for working with the Spring framework. Use of these is entirely optional of course. The first of these is a "BeanConfigurer" aspect that enables Spring to dependency inject domain objects simply by annotating them with "@Configurable" (the annotation is @SpringConfigured in CVS, but we plan on changing the name). We believe the ability to dependency inject domain objects (created using the new operator, or by your ORM mapping tool for example) is a big step forward for folks who want to embrace richer domain models (and from TSE last week, I can tell you that there certainly seem to be a good number of them).
  • Spring AOP as a framework is not growing beyond its original boundaries. Instead we've simplified the configuration and enabled the use of the AspectJ pointcut language and even @AspectJ aspects. Instead of replacing Spring AOP with AspectJ, or growing the capabilities of Spring AOP beyond its current bounds, we believe in providing a seamless roadmap from using the out-of-the-box Spring aspects (such as the transaction management support), thru writing your own Spring aspects and advisors, and onto AspectJ aspects, without any jarring discontinuities. Thus you can use as little or as much of the capabilities as you need, and as your requirements change there will be a solution available to support you.

    Posted by adrian at December 15, 2005 10:24 AM [permalink]


    Post a comment

    Thanks for signing in, . Now you can comment. (sign out)

    (If you haven't left a comment here before, you may need to be approved by the site owner before your comment will appear. Until then, it won't appear on the entry. Thanks for waiting.)

    Remember me?