Metamodelling based on the EMF tree views is not a very good solution. A better solution is a textual representation for Ecore models. The IBM Emfatic plugin provides this support.
Install the Emfatic plugins from http://www.alphaworks.ibm.com/tech/emfatic.
If you already have an ecore file (such as our
data.ecore
in our example), you can right-click on
the file and select the Generate Emfatic Source item.
The following code is generated from our data.ecore
file into a file called data.emf
. After changing the
source in the emf file, you can right-click that file and select
Generate Ecore Model to transfer it back.
The syntax should be self-explaining. One remark: To render containment relationships, EMfatic uses the val keyword, not ref, see in the screenshot in the Entities attributes, for example.