JVM level AOP; interesting, very interesting

by Russell Miles

Related link: http://dev2dev.bea.com/pub/a/2005/08/jvm_aop_2.html?page=1

Aspect Orientation (AO) is still on the outskirts of the developer community, waiting for its time in the limelight (I for one hope that that will not be too far off) and this article by Alexandre Vasseur, Jonas Boner and Joakim Dahlstedt aims to show how the power of the AO approach can be applied, often more efficiently, at the JVM level.

The concept of doing all the AO work at the JVM is not necessarily a new one but full marks to Jonas and the guys at JRockit for creating what is a really nice set of API extensions that in turn take advantage of the AO JVM optimisations. The danger was that this approach would tie you to one AO language or framework, but the JRockit team have avoided this by providing the underlying constructs with which AO programming can be achieved. So, in many ways they have built the foundation upon which AO languages, such as AspectJ could potentially take advantage of runtime optimizations, if and when the JVM supports it.

However, there are a couple of down sides-aren't there always. Much of the static cross-cutting behavior, the ability to change the actual static structure of your classes, that is part of so-called heavyweight AO implementations such as AspectJ is not really present in the JRockit JVM AO extensions. Not surprising really as these tend to be advanced AO problems, and many lightweight frameworks don't include them anyway.

Another problem is likely to be that this approach for implementing AO in the JVM is totally non-standard right now; heck, the guys at JRockit are not pretending that it is. One thing their effort does show though is that AO in the JVM can work and be implemented in a higher level framework independent way. So rather than presenting their work as the AO implementation, the JRockit team have really just made the first important step towards potential standardization of AO support, focussing clearly on the JVM level.

All in all, this is a nice attempt at pushing the boundaries of AO implementations and so hats off to the guys at JRockit. Time will tell if this makes a real impact, but the sooner they release the prototype implementation (ideally so that I can run it on my Mac) the better.

Looking to the future I can see some really great opportunties for AOP that is integrated into the JVM, especially in managing large application feature concern updates. It would be great to here from you if you have had some success in doing this (using regular AOP frameworks or something more JVM-centric).