[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] RE: newbie: wildcards in pointcuts

Joost,

although this challenge has been discussed on the mailing list before, it won't get old until there's a solution or a well established set of practices for dealing with it. In fact, it was because of users like you that we now have a greatly expanded -Xlint feature. The compiler in 1.0.x did not warn you when you typed Printstream.*. (error = lowercase s) Consider looking into the various -Xlint options if you want more feedback from the compiler.

I think the metadata facility will really help AspectJ. In the meantime, consider using other Java information (modifiers, inheritance relationships) to determine which joinpoints should be included:

declare parents : This || That || TheOther implements ServiceBoundary;
pointcut boundaryMethods() : call(public * ServiceBoundary+.*(..));

Cheers,
Nick
On Mar 8, 2004, at 7:27 AM, Joost de Vries wrote:

Ok, sorry if I misunderstood and represented your thoughts falsely. I'm
aware I'm a newbie in this field.
I understand what you're saying: in my case annotating with a tag
"to_be_publicized_on_queue" would be not suitable for reuse while the tag
"boundary_service" would be correct.


It's just that I really like the immediate feedback the javacompiler gives
when I refer to a class or method that does not exist.
Using wildcards I get the feeling that I suddenly dropped from the world
of Java to Javascript where I only find out at runtime if the system that
we deployed does include the aspect correctly. Since I'm the only
developer on the project right now who has some grasp of aspects the build
could easily be broken without anybody finding out until the system is
running. As you can imagine this makes me uneasy.
Is there something in the works for the aspect-compiler that provides this
kind of immediate feedback, in the appropriate cases, for pointcuts that
do not refer to any joinpoints?


I hope I'm not rekindling an argument that has already been beaten to
death on the mailing-list.
*ducks* Don't hit me, I'm just a newbie!  :-)

groetjes uit nederland,

Joost de Vries


From: Joost de Vries
Sent: Monday, March 08, 2004 1:06 AM

Or just refer to a unique
metadata tag just like when I'm referencing a class.
Of course the new metadata spec in JDK 1.5 is ideal for this.
I seem to
recall that Gregor is opposed to using metadata since the code that is
being enhanced should not have knowledge of the fact that it is being
enhanced.

I'm not opposed to using metadata tags in pointcuts. I think there are cases where that is exactly what you want. What I have tried to say, but not very clearly, is that doing this all the time would be a shame, because it violates the nice non-invasive property of using other kinds of pointcuts. And that when you do use such tags, the tags should be named for a property of what is true of those methods, not for what the aspect will do. That makes the tags more reusable by other aspects, in other configurations etc.


_______________________________________________ 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