Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[aspectj-users] Re: Interface Constructors

Jim,

>The only way I can think to do this in AspectJ-1.1 is ugly:
>
>     execution(new(..)) &&
>if(!thisJoinPointStaticPart.getSignature().getDeclaringType().isInterface
())

Thanks. This is pretty much what I did although I was unaware of the
"isInterface()" method. I will use this an possible move the test from the
method where it is now to the advice to make myself "future proof" wrt
optimization ;-).

One thing I did notice looking at the generated byte code was two calls to
the advice from my constructor: one for the implementing type, one for the
interface (I was trying to avoid the 2nd call with an appropriate
pointcut). However I also noticed 2 separate calls to "aspectOf()",
something that could also be optimized to 1 perhaps?

Matthew Webster
AOSD Project
Java Technology Centre, MP146
IBM Hursley Park, Winchester,  SO21 2JN, England
Telephone: +44 196 2816139 (external) 246139 (internal)
Email: Matthew Webster/UK/IBM @ IBMGB, matthew_webster@xxxxxxxxxx
http://w3.hursley.ibm.com/~websterm/

The IBM Academy is sponsoring a conference on Aspect-Oriented Software
Development, 3rd-4th September, Yorktown, NY.



Back to the top