You need a pointcut library. You _will_
have to update the library each time you add an interface to you application
but you won't have to change the aspect. Also the library can be shared
between aspects.
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/
"Jean Bovet"
<jbovet@xxxxxxxxx> Sent by: aspectj-dev-bounces@xxxxxxxxxxx
26/10/2006 18:15
Please respond to
AspectJ developer discussions <aspectj-dev@xxxxxxxxxxx>
The project I am working on requires a lot of interfaces to be weaved and
more interfaces will be added in the future. I am trying to find an easy
way to add all the existing interfaces (and the future ones) into my aspect
class without having (1) huge pointcut definition or (2) to modify the
aspect code each time a new interface that need to be weaved is added.
Is there an elegant way to achieve that? Or is there a way to specify an
external file that will contain the list of pointcut to take into consideration
for a specific advice. For example:
I am not sure I fully understand your question. Are you writing pointcuts
that match annotations declared in the classes you wish to advise? I this
statement puzzles me: "each time a pointcut changes,
I will have to change the annotation".
Can you post an example of what you are trying to do?
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/
[aspectj-dev] Specifying pointcuts in
an external file
Hi,
Is it possible to specify pointcuts in an external file when using the
annotation AspectJ? I am asking this question because our project will
contain a lot of different pointcuts: what is the easiest way to define
them? Using annotation is a bit a pain because each time a pointcut changes,
I will have to change the annotation. Any method to load these pointcuts
from an external source?