Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] declare precedence question

Hi Ron,

thank you for the clarification. I did not see the documentation page you are referring too, however google helped me find it :) -> http://www.eclipse.org/aspectj/doc/next/progguide/semantics-advice.html#d0e6293

So, if I understand it correctly: Having 2 aspects A1 and A2 advising the same joint point and having this declare precedence:

declare precedence: A1, A2, *

This would be the order:

A1 before advice
A2 before advice
method body
A2 after advice
A1 after advice


Maybe you can link this page with the one where declare precedence is explained ( http://www.eclipse.org/aspectj/doc/next/progguide/semantics-declare.html#advice-precedence

And ofcourse an example would also be nice.

regards,

Wim



2006/7/27, Ron Bodkin <rbodkin@xxxxxxxxxxxxxx>:

Wim,

 

The precedence order has a different effect before and after a join point: higher precedence advice runs earlier before the join point but later after the join point (it's the dressing/undressing principle).

 

The section under the heading "Effects of precedence" could certainly make this more clear, although it can be deduced from the language there:

"A piece of before advice  … If it returns normally, however, then the advice of the next precedence… will run"

"Running after […] advice will run the advice of next precedence… Then the body of the advice will run."

 

p.s. There's a typo in that section too: while a "join pint" sounds somewhat refreshing, it's probably not what was intended…

 


From: aspectj-users-bounces@xxxxxxxxxxx [mailto: aspectj-users-bounces@xxxxxxxxxxx] On Behalf Of Wim Deblauwe
Sent: Wednesday, July 26, 2006 11:42 PM
To: aspectj-users@xxxxxxxxxxx
Subject: [aspectj-users] declare precedence question

 

Hi,

I have a question on declare precedence: Does the order of the aspects in the list give the order in which the aspects are applied?

Looking to http://www.eclipse.org/aspectj/doc/next/progguide/semantics-d.eclare.html#advice-precedence , it states: "This signifies that if any join point has advice from two concrete aspects matched by some pattern in
TypePatternList, then the precedence of the advice will be the order of in the list."

The way I understand this is that an aspect that is first in the list has higher precedence, and thus is executed first, right?

However, looking to http://www.eclipse.org/aspectj/doc/released/progguide/examples-production.html#d0e3260 , I see there "...and Billing is declared to be more precedent than Timing to make sure that this advice runs after Timing's advice on the same join point.", which seem to indicate the opposite.

x


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




Back to the top