[aspectc-user] aspect conflict resolution
mathias.kurth at s2000.tu-chemnitz.de
mathias.kurth at s2000.tu-chemnitz.de
Sun Jun 15 18:12:24 CEST 2003
Hello,
I've got a question about aspect conflict resolution in AspectC++.
I have the following aspects:
aspect Outer1 {
pointcut virtual p() = 0;
advice p() : before() {
printf("before p in Outer1\n");
}
};
aspect Outer2 : public Outer1 {
pointcut virtual p() = call("% %::Print(...)");
advice p() : before() {
printf("before p in Outer2\n");
}
};
How is the order of the advices to p() defined?
In AspectJ it is said that all advices in the derived class
do have prefenence over the advices in the base class.
I've tried to apply this to the aspect compiler, but
the result was the following:
static inline void a0_before_Outer2_call_main_FiiPPcE_0() {
printf("before p in Outer2\n");
}
static inline void a0_before_Outer2_call_main_FiiPPcE_0() {
printf("before p in Outer1\n");
}
static inline void __call_main_FiiPPcE_0_0 (::test::CAspectTest1
*dstthis) {
a0_before_Outer2_call_main_FiiPPcE_0();
a0_before_Outer2_call_main_FiiPPcE_0();
dstthis->Print ();
}
I think this is surely not the expected result. The generated
output was not compileable with the backend compiler.
Another point is what would be if the pointcut was not virtual.
How is the order defined if the base and the derived aspects
do advice to some pointcuts which include the same join points?
Is it possible or is something planned to trace all conflict situations
(means: the intersection of pointcuts is not empty) in a certain
project during a compiler run?
I think this would be a very usefull feature.
Another question to the Aspect Ordering and Aspect Behavior Contracts
mentioned in several documents (e.g. in the poster AspectC++ on
www.andreasgal.com, paragraph 3.3 and 3.2):
It seems that these features are not implemented yet. So when
will they be available?
What happens, if you order the advices within a join point using
a order-statement an you try to apply a second order (which is
perhops different in terms of ordering)?
Will you get an error or is the second one ignored or happens
something other?
best regards
Mathias
More information about the aspectc-user
mailing list