How can I add eOpposite relationship to an existing attribute? [message #415589] |
Thu, 20 December 2007 17:51  |
Eclipse User |
|
|
|
Originally posted by: fchen.castortech.com
I want to extend an ecore metamodel. And add some eOpposite relationships
to the eStructuralFeatures which have already defined in the base ecore
model.
For example, I have this EXTENDED_MODEL.ecore which extends
BASE_MODEL.ecore.
in the BASE_MODEL.ecore,
I defined
<eClassifiers xsi:type="ecore:EClass" name="Element" abstract="true">
<eStructuralFeatures xsi:type="ecore:EReference" name="attribute"
ordered="false"
upperBound="-1" eType="#//Attribute" containment="true"/>
</eClassifiers>
now I want to add eOpposite relationship to this "attribute" in
EXTENDED_MODEL.ecore.
Is it possible to allow me to do that in .ecore model, if possible, how
can I achieve it?
Thanks in advance.
|
|
|
|
|
Re: How can I add eOpposite relationship to an existing attribute? [message #415657 is a reply to message #415653] |
Wed, 26 December 2007 06:31  |
Eclipse User |
|
|
|
Dereck,
Adding a bidirectional reference definitely requires actual
modifications to the models containing each of the two EReferences.
Since Ecore is just a model as well as being a metamodel, I think ATL
should still be applicable. I could also imagine "scripting" such
changes as a small Java utility that reads the model, looks for classes
by name, and makes changes that way...
Dereck wrote:
> Thanks Ed,
> It seams that it is impossible to use the �extend� approach to fix the
> problem.
>
> In my situation, the BASE_MODEL.ecore is a standard metamodel from the
> third party. We modify it to meet some special needs for our company.
> Every time, when the new version of the BASE_MODEL.ecore is released,
> we have to go over the annoying process again to add those special
> features and relationships into it. I was thinking ALTAS, but it is
> apparently for model transformation, not for metamodel.
>
> Is there any tool or plugin available to meet this need? Do you have
> any suggestion for this?
>
> Thanks again
>
> Dereck
>
|
|
|
Powered by
FUDForum. Page generated in 0.05401 seconds