Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] "declare precedence", are there best practices or ways to avoid problems

Hi Simone,

It might be worth spelling out some detailed scenarios that show the problem you are having with declare precedence.  I mean if you do have 'declare precedence: Me *' and 'declare precedence: * Me' when composing the system as a whole -  what are you really trying to say?  Is Me more important than everything else or is everything else more important than Me?  Why is it that sometimes Me is more important and sometimes it is less important?  I don't deny there are probably some unwanted problems with clashes but I think spelling out a scenario or two will help with thinking about things.

I don't mind an enhancement to ease collision resolution (and this would be much easier to implement than the ITD changes if you wanted to have a go at doing it!) - but I think it is worth spending some time discussing the problem situations to come up with the right solution.

cheers,
Andy.


2009/6/21 Simone Gianni <simoneg@xxxxxxxxxx>
Hi all,
my Apache Magma Lab is composed of 115 aj files. As you can imagine, precedence is an issue, and declare precedence is becoming a nightmare.

The biggest problem is that declare precedence is strict, if there is a collision AspectJ refuses to weave, and I don't know a way to make it "lenient".

For example, there are a couple of constructs ("declare precedence : Me *" and "declare precedence: * Me") that are handy, and would be even better it they could be interpreted with "PS: but it's not that important".

Since all these .aj files are organized in different projects, the problem is even worse : the collision becomes apparent only when two colliding aspect libraries are used; this creates a "logical" coupling between two otherwise unrelated projects; since those two projects are not coupled there is no way of declaring the precedence placing one aspect in relation with the other.

A possible enhancement to AspectJ could be to provide a lenient way of solving collisions, in situations where two aspects have the same precedence and the developer doesn't give any explicit ordering, report a warning and then apply the two aspects in any order, as it does when no declare precedence is present.

In the mean time, are there any established best practices? Do you have any ideas? Do you have any experience to share?

Simone

--
Simone Gianni            CEO Semeru s.r.l.           Apache Committer
http://www.simonegianni.it/

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


Back to the top