[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [aspectj-users] Why AspectJ do not have "Advice name"?

Hi Sai,

 

This has been discussed in past. Briefly, the main argument for not naming advice was so people would not be led into thinking it should be called directly. Now, I think named advice is actually useful to document the code, to allow for matching adviceexecution, and also to allow testing (if you can invoke directly). With Java annotations there is @AdviceName that serves two of these purposes, if you are using annotations

 


From: aspectj-users-bounces@xxxxxxxxxxx [mailto:aspectj-users-bounces@xxxxxxxxxxx] On Behalf Of Sai ZHANG(??)
Sent: Friday, December 15, 2006 6:01 AM
To: aspectj-users@xxxxxxxxxxx
Subject: [aspectj-users] Why AspectJ do not have "Advice name"?

 

Hi everyone:

These days, i am thinking about one interesting question - why aspectj
do not have the "advice name"? As well all know, in aspectj, we define
the advice code just like below:

aspect A {

pointcut B...

before:B() { }

}

 

before:B() is the advice code, why don't it have a name, just as B (the
pointcut name)?

If that, the aspect may be defined as:

advice advice_name before:B() {....}

does anyone thing it is better?

I am wondering why the AspectJ designers do not assign a name to the
advice?

Does anybody know that? :-)

Thanks a lot/best regards.



--
Sai ZHANG ( åèï
School Of Software, SJTU