Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] How do define the pointcut dynamically



Alexander,

While the late definition of simple scoping pointcuts can be useful for
auxiliary aspects (tracing, logging, ...) in general having the complete
definition of your concern in one place and one language is much clearer.
You can get close to what you want using abstract aspects and abstract
pointcuts where the concrete aspect merely defines the scope. Changing such
an aspect is no more arduous than changing an ini file apart form the fact
that it must be compiled. However you will have to parse the ini file for
correctness at some stage.

Please see this thread for a discussion of runtime pointcut configuration:
http://dev.eclipse.org/mhonarc/lists/aspectj-users/msg02265.html.

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/


pope <alexandru.popescu@xxxxxxxxx>@eclipse.org on 13/10/2004 11:52:28

Please respond to aspectj-users@xxxxxxxxxxx

Sent by:    aspectj-users-admin@xxxxxxxxxxx


To:    aspectj-users@xxxxxxxxxxx
cc:
Subject:    Re: [aspectj-users] How do define the pointcut dynamicly


Quote [Lendvai Attila]:

> :: Hi, all,
> ::
> :: I create a pointcut like this:
> :: public  aspect TestAspect{
> ::     pointcut operation : call (* MyClass.*(..));
> :: }
> ::
> :: I want to write a ini file to record the pointcut scope, in
> :: this example
> :: is "* MyClass.*(..)".
> :: The ini file maybe like this:
> :: * MyClass.*(..)
> ::
> :: and later I change it to:
> :: public  MyClass.*(..)
> ::
> :: I think if I can bind the pointcut dynamiclly, we needn't change the
> :: source file.
> :: I wonder whether AspectJ can provide this ability?
>
> AspectJ is a static environment just like Java, which is a little
> 'dynamic' due to the new load time weaving (LTW) feature.
>
> But even with LTW you can't dynamically invoke the compiler to recompile
> your aspects, not to mention doing that automatically based on
> depencencies. That is the scope of dynamic languages with integrated
> persistence, which Java isn't one of. Could be, but it's vm written in
> C++ (?) is not the best environmnet to implement such features... :)
>
> This does not mean that AspectJ could not implement special support for
> this, but I don't know of that.
>
> Hope it helps,

I think at some point there was a discussion about AspectJ and Spring which
offered something near.

./pope

>
> - 101
>
> _______________________________________________
> aspectj-users mailing list
> aspectj-users@xxxxxxxxxxx
> http://dev.eclipse.org/mailman/listinfo/aspectj-users
>

_______________________________________________
aspectj-users mailing list
aspectj-users@xxxxxxxxxxx
http://dev.eclipse.org/mailman/listinfo/aspectj-users





Back to the top