Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[aspectj-users] Re: Kudos, J2EE pointcuts, and Dynamic AOP

Hi Ron,

Ron Bodkin wrote:

I just posted this to the TSS discussion, but wanted to make sure you saw it (since I'm a bit late). What are you thoughts on working on a generally available set of J2EE pointcuts?

I think the J2EE specification already lends itself pretty well to this. Sam knows the ins and outs of the pointcuts he wrote better than me, but it seems to me the vast majority of them are already generic, because they are based on the J2EE API's and are exclusively callee pointcuts (i.e. they crosscut user code, not the application server).

The more problematic definitions are those that are user-based, like EJB business methods. There are two challenges here :

- they have to be defined in terms of set negations: "not a CMP field, and not a finder, and...". - they need to contain some proprietary cruft in order to exclude the concrete implementations generated by the application server

Right now, my feeling is that the pointcuts shipped in this early version are reasonably close to "as generic as it gets", but I guess that in order to find that out, someone will have to try and port them to an application server other than WebLogic Server.

--
Cédric
http://beust.com/weblog

[rest of message quoted below]




---

Sam and Cedric - it's great to see the work you've done has been released. I think you have put your effort in the right area, by building on the most mature AOP implementation and then defining useful applications. Defining a standardized set of pointcuts for WLS is a great step towards reusable libraries. Adrian Colyer and I have started work on something similiar for a reusable library of J2EE aspects. Adrian and I think it would be even better to create a standard library for any J2EE that's released by the AspectJ project. The WLS specific pointcuts could be incorporated with extensions or implementations. I think it would be great for users to have a J2EE library that the WLS one extends, and it would also be good to extend AspectJ support for reusable libraries (Adrian has already made a suggestion based on this). This work would also be easily to translate to other AOP frameworks (as long as they have a rich enough model for pointcuts and mechanisms for reuse).

Having AspectJ weaving integrated into the WLS classloader is a big win (having recently worked to get Tomcat to compile JSP's with AspectJ this capability would be most welcome).

I'd also like to pick up on the topic of dynamic AOP. Having static AOP, like static OO, gives you two very powerful capabilities: good tools support, and compile-time checking. If you haven't seen how AspectJ IDE support allows developers to see how aspects affect their base code, you should take a look (e.g., in AJDT for Eclipse). It's not generally possible to identify advice or introductions that are deployed dynamically when viewing source (or UML).

While there are some use cases where dynamic AOP  would be helpful, I think AOP systems need to support static AOP primarily (just as you wouldn't build a Java system using only reflective calls!)

One can also write AspectJ aspects to address a handful of system-wide dynamic concerns that many POJOs might implement. If you made them all implement a _marker_ interface like Advisable (as JBoss does), then you can write advice with a test for whether this object is affected (using introductions or a hash map). If the number of aspects gets large, then the performance cost of these tests would favor a truly dynamic approach. But for a small number, this should be quite competitive.

Ron

Ron Bodkin
Chief Technology Officer
New Aspects of Security
m: (415) 509-2895





Back to the top