| [news.eclipse.tools.emf] Re: The definitive truth about multiple inheritance |
Guillaume,
Comments below...
Class is a bit of a confusing name.Ed,
I will try to decrease your headache ...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?You are right : my explanation is more complex than what I want to describe.
So :
- A inherits from Action
- C inherits from Class
Did you declare all these methods in Ecore's version of Class? I'm suspicious about that name...- D inherits from both A and C So simple when it is clear !
The generated code :
- the class DImpl extends the class AImpl : it is OK.
- the class DImpl implements the interface D ; the interface D extends the interface A and the interface C.
- the class DImpl inherits methods from AImpl : so it implements the interface A;
- the class DImpl contains methods that are declared in the interface C ;
- BUT DImpl does not contain methods that are inherited by the interface C from the interface Class.
So, the class DImpl should be declared abstract, because it does not implements the methods inherited by the interface C that it should implement.I have this suspicion that perhaps Class has methods in Java, that you didn't actually declare as EOperation in the Ecore wrapper...
You've not been entirely clear if you're talking about EOperations or EStructuralFeatures, which leads to my suspicion about what you declared in Ecore verses what's there in Java....
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.It is exactly what I expect. Instead, I get a partial implementation.
Yes, but I'm more suspicious that there's something you've not stated explicitly. EMF won't know to implement a method if there's no EOperation declared for it in Class. I'm pretty sure if you specify the right EOperations, there's at least be stub methods generated.
Yes, it does not compile, because the class lacks some methods, those from the class Class inherited by the interface C.What can I do to solve my problem ?Are you saying that's generated doesn't compile?
Do you see what is my problem now ?
And do you see a solution ... ?I'd suggest you provide an example model that I can use to reproduce the problem. Then I can tell you if the problem is your model or in the framework.
Guillaume Vauvert http://www.ixmas.org