[abc-dev] Extension

From: Albert Bachand <albertb@gmail.com>
Date: Wed Mar 22 2006 - 21:39:25 GMT

Hello,

I'm trying to write an extension for abc. Basically, I'm trying to implement
"per-instance aspects". That is, I want to make aspects "associable" and
only have advices triggered when the 'target' of a pointcut (or the 'this')
is associated with the aspect. Instances are associated and disassociated
with an aspect using two methods (associate(Object) and
disassociate(Object)) and pointcuts check for association using two new
keywords (associatedthis() and associatedtarget()).

Right now, I decided to simply have each aspect keep track of instances
associated with it using a static List. Then checking whether an instance is
associated with an aspect is simply a matter of checking whether is it a
member of that List.

So far, I managed to extend the parser to recognize my new keywords and
started looking at ContextVisitors and Resdidues. My first question is where
should I generate the code that creates the List field inside the aspect?
(Every associable aspect needs a static List that keeps track of associated
instances.) Should it go in a ContextVisitor that visits all nodes until it
finds an aspect that has been marked as associable and then generate the
code in enter()? My second question is about the association Residue: I
started writing an IsAssociated residue that can be used for both 'this' and
'target' association but I'm not sure how to refer back to the aspect from
the codeGen method. I would need to generate code that checks whether the
instance is in the List of that aspect before proceeding with the adivce.

Any help would be greatly appreciated.

Thanks in advance,
Albert
Received on Wed Mar 22 21:39:29 2006

This archive was generated by hypermail 2.1.8 : Thu Mar 23 2006 - 10:10:05 GMT