|
|
Re: Inegrating ECore Models [message #518870 is a reply to message #518851] |
Fri, 05 March 2010 10:42 |
Maximilian Koegel Messages: 253 Registered: July 2009 |
Senior Member |
|
|
Hi Ed,
thank you for the very fast and very helpful reply. The EMF newsgroup
really rocks, no other newsgroup where I get good replies so fast!
Cheers,
Maximilian
On 3/5/10 10:53 AM, Ed Merks wrote:
> Maximilian,
>
> Comments below.
>
> Maximilian Koegel wrote:
>> Hi,
>>
>> in my application I have two Ecore Models A and B. I want all EClasses
>> in B to be subclasses of a selected super class in A. Since B is
>> replaceable in the application I want to make it as easy as possible
>> to add the super class for new B models.
>> I played with the "Root Extends Class" and "Root Extends Interface"
>> properties in the gen model but they only "connect" the class
>> hierarchy on the Java level not on the Ecore level.
> Yep.
>> For example all features of the superclass are not serialized to a
>> resource if I use this approach.
> No, it's not the right approach for letting the model itself know about
> the inheritance.
>> Is there any way to make this work on the Ecore level also? Mabye a
>> way to make an EClass superclass of another EClass at runtime?
> No, it needs to be knows at generation type for generated models.
>> B is generated. While A is generated also it could also be a dynamic
>> ECore if this helps to solve the problem.
> No, that won't. And it doesn't make sense for a generated model to
> extend a dynamic one.
>>
>> I appreciate any hint!
> You could define an object action contribution that applies to an
> EPackage and would add to the eSuperTypes of all the contained EClasses.
>
> Easiest is to define something like a BModelElement, ensure that all
> other classes in B extend it, and then you'll have only one place to add
> A's super class.
>>
>> Thank you,
>> Maximilian
|
|
|
Powered by
FUDForum. Page generated in 0.03101 seconds