| [news.eclipse.tools.emf] Re: The definitive truth about multiple inheritance |
Guillaume,
Comments below.
Happy to join the team of EMF's users !Welcome. :-)
I keep reading this and it's making my brain hurt. Maybe you could draw a picture or make explicit what methods you're talking about. Is D inheriting from C or is it A that's doing that, or is the comma implying that C inherits from Class but is otherwise unrelated?
After many searches, I have found no clear answer to my basic question about multiple inheritance.
The EMF documentation (http://help.eclipse.org/ganymede/index.jsp?topic=/org.eclipse.emf.doc/references/overview/EMF.html , chapter "EMF developper guide", section "EMF developper guide", subsection "EMF Framework Programmer's Guide") saids :
"As in Java itself, multiple interface inheritance is supported, but each EMF class can only extend one implementation base class. Therefore, when we have a model with multiple inheritance, we need to identify which of the multiple bases should be used as the implementation base class. The others will then be simply treated as mixin interfaces, with their implementations generated into the derived implementation class."
The example shows a model with a class [SchoolBook] that inherits <<extends>> [Book] and that inherits [Asset]; this class should be implemented by extending (Java) the class Book and implenting the methods of the class Asset by copying them from Asset.
I tried to apply that to my model :
D inherits from A that inherits from Action, and C that inherits from Class.
The implementation of class D does provide implementations for methods found in A and C, but does provide no implementations for methods coming from inheritance of the class not extended (Action or Class depending on the class (C or A) that D extends).
So far it's probably me that's missed something.
Have I missed something ?
If not, why isn't it possible for EMF to automatically generate the "good" implementation ?The point that is that if you consider the super types Y and Z of an EClass X, XImpl will extend YImpl and will generate a clone of what's in ZImpl. So it should indeed be possible to generate a complete implementation.
What can I do to solve my problem ?Are you saying that's generated doesn't compile?
Thank you very much for clarify my knowledge ...
Guillaume Vauvert http://www.ixmas.org