[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
Re: [aspectj-users] Introductions and multiple inheritance (sort of)
|
Another is that you cannot implement two different interfaces which
implement methods (using introductions) with the same signature (this
one is particularly troubling).
You can solve this problem by implementing the conflicting method on
the target of the ITD directly (with a single-method ITD perhaps). This
solution does not trouble me--why do you find it troubling? I'd whip up
an example, but there'd be a lot of typing involved and I'm at work
ATM.
resolving ambiguities in method calls
Does the previous solution also cover this problem?
knowing whether attributes inherited from a common base through
different base classes are duplicated or not,
Can you give a code level example of what you mean here?
you cannot use super within an overriding method (super refers to the
extended class, not the implemented interface)
I agree, some more clarity on this issue would be nice... I think that
some sort of syntax like
MyInterface.super.someMethod()
should be supported to allow references to the implemented interface.
(The syntax is similar to the way you can reference potentially
ambiguous methods in an inner class). You could consider raising a bug
in bugzilla on this issue.
Is there a detailed description of the way multiple inheritance works
in AspectJ?
My book talks a little about this, but you may be looking for more
detail than I provided.
cheers,
Nicholas Lesiecki
Software Craftsman, specializing in J2EE,
Agile Methods, and aspect-oriented programming
m: 520 591-1849
Books:
* Mastering AspectJ: http://tinyurl.com/66vf
* Java Tools for Extreme Programming: http://tinyurl.com/66vt
Articles on AspectJ:
* http://tinyurl.com/66vu and http://tinyurl.com/66vv
On Jan 20, 2005, at 7:27 AM, Manuel Menezes de Sequeira wrote:
Hi,
AspectJ introduces a limited form of multiple inheritance into the
Java language, using introductions. Multiple inheritance poses some
interesting problems, such as resolving ambiguities in method calls,
knowing whether attributes inherited from a common base through
different base classes are duplicated or not, etc. I have made a few
experiments and got to a few troubling conclusions. One of them is
that when you implement an interface with an introduced method
implementation, you cannot use super within an overriding method
(super refers to the extended class, not the implemented interface).
Another is that you cannot implement two different interfaces which
implement methods (using introductions) with the same signature (this
one is particularly troubling). Is there a detailed description of
the way multiple inheritance works in AspectJ?
Thanks in advance,
Manuel
_______________________________________________
aspectj-users mailing list
aspectj-users@xxxxxxxxxxx
http://dev.eclipse.org/mailman/listinfo/aspectj-users