Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] Is there a common syntax for a compile time "if"pointcut?

Eric, it looks like SCoPE is an ABC extension.

Hidehiko, I am interested by some details.
As far as I can see I can write in SCoPE:
"... && if(thisJoinPointStaticPart.getSignature().getDeclaringType()
instanceof Serializable)"

This means I introduce a dependancy on the getDeclaringType() that is
to return a Class instance - the currently beeing weaved or compiled
class - say X.

That sounds surprising to me if you really manage to do that since:
- if you are compiling the class X, how would you have it loaded in
the VM, aside, in which VM (there might be issue with incremental
builds). You are precisely compiling it so that should somehow be an
invalid class thus impossible to compile in theory.
- if you are weaving the class X (say binary weave), how would you
have it loaded in the VM as well - this somehow means the bytecode is
not yet ready or that you may have a half weaved version.

The use case is very appealing, and I had given it some thoughts in
AspectWerkz. I would have gone for a different implementation, where I
would have exposed a "wif" (weave time if) pointcut, that could then
expose a different abstraction than JoinPoint (based on
java.lang.reflect) to rely on the compile/weave time structure we have
behind anyway (thus no need to load any curently beeing compiled
class, but the syntax would have been something like
"... && wif(thisShadow.....)" where thisShadow is slightly different
from what is exposed in JoinPointStaticPart.
Using that would immediately allow ones to implement hasField style
pointcuts that are purely static (though ITD can comes into the game).
In that case I would have to still evaluate the little syntax you
would use in some context but I would definitely not need to actually
load the class beeing weaved/compiled.

Could you explain me some more the details of your impl. in SCoPE, or
perhaps the pointcut I gave will only be evaluated at runtime ?

Alex



On 6/3/05, Eric Bodden <eric@xxxxxxxxx> wrote:
> 
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Just for your information: abc (www.aspectbench.org) can do so as
> well. It even allows for the use of cflow under certain circumstances
> IIRC.
> 
> Eric
> 
> Hidehiko Masuhara wrote:
> > Hi Scott,
> >
> > You might be interested in our SCoPE compiler, which we
> > coincidentally just have released.  It directly supports what you
> > want to do---"if"
> > pointcut can be used with declare warning/error when the conditions
> > are static.
> 
> 
> - --
> Eric Bodden
> Chair I2 for Programming Languages and Program Analysis
> RWTH Aachen University
> 
> -----BEGIN PGP SIGNATURE-----
> Version: PGP 8.0.3
> 
> iQA/AwUBQqA9EcwiFCm7RlWCEQJCyACguQrGEKTdDf8+dcvXcZSLD2kYQpQAn0cV
> 2mTW0TWQw9gzjAlXOwBMs1lv
> =2jKM
> -----END PGP SIGNATURE-----
> 
> 
> _______________________________________________
> aspectj-users mailing list
> aspectj-users@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/aspectj-users
>


Back to the top