From Jeffrey Palm: Here is an interesting proposal from Eelco Rommes, so if anyone has encountered a similar situation or would like to comment on Eelco's idea we'd love to hear from you. Please respond to users@aspectj.org. Thanks. Jeff From: Eelco Rommes This brings us to the next feature request: a more expressive introduction, able to introduce all methods that are in an interface (or type) and that share the same body (in this case: an empty body). Adding this kind of feature would be - in my opinion - a great improvement of AspectJ. Eelco Rommes ======= Yes, more expressive introductions would be very useful in AspectJ. I can see the use of introductions where the method body depends in a very regular manner on the class to which the method is introduced. A nice application of this would be a persistence aspect (that Eelco mentions) where we first define which subobjects need to be made persistent (writing a traverse method) followed by advice on the traverse method that enhances the traversal with code that writes to a database. We have implemented such a tool in the form of a Java library called DJ (which works in conjunction with AspectJ or independently). The persistence aspect would be expressed in plain Java as follows: cg.traverse(object, whereToGo, persistenceAdvice); where cg is the UML class graph computed by reflection, whereToGo is an object that describes the traversal and persistenceAdvice is an object that defines advice on the traversal. It is important that the three topics: UML class graph structure, traversal, and advice are only loosely coupled making the above "introduction" work with lots of class graphs. See: http://www.ccs.neu.edu/research/demeter/DJ/ for more information. (implemented and maintained by Doug Orleans who has posted earlier to this list.) DJ is in the style of Crista Lopes' work in: http://www.ccs.neu.edu/research/demeter/papers/publications-abstracts.html#REFLECTION96 but all the traversal computation is done at run-time and all is expressed in plain Java making it compatible with AspectJ. -- Karl Lieberherr