[aspectc-user] "dummy"/"null" Code JoinPoints and (pure) virtual aspects

Reinhard Tartler siretart at tauware.de
Mon Sep 4 14:21:19 CEST 2006

In my framework, I expect the user to specify the user the Jointpoints
to instrument in 2 pointcut expressions, lets call them ''with_context''
and ''without_context''. I provide a 'base' aspect, which declares 2
virtual pointcuts like this:

aspect InstrumentationBase {
  pointcut virtual dyn_advice_with_context() = 0;
  pointcut virtual dyn_advice_without_context() = 0;

I noticed that if the user doesn't specify both, the aspect remains
'pure virtual' and doesn't get instantiiated at all! This means that
nothing gets instrumented. The solution is the define both, even if one
of the 2 pointcuts shouldn't match any joinpoints. The first naive
approach would be to say

  pointcut dyn_advice_without_context = "";

This doesn't work, because a codejoinpoint is expected. My current
workaround is to say this:

  pointcut dyn_advice_without_context = call("");

This works for me [tm], but looks messy. 

I'd like to ask you what you think about this. Shouldn't it be easier
(or more obvious) for the user to define a ''Null Joinpoint set'',
perhaps by using a new pointcut function?

Or regarding my specific problem: Is it really necessary that the user
needs to define both pointcuts?

Reinhard Tartler, KeyID 945348A4
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 213 bytes
Desc: not available
URL: <http://www.aspectc.org/pipermail/aspectc-user/attachments/20060904/e6946da8/attachment.sig>

More information about the aspectc-user mailing list