Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

One of the great advantages of modeling data with a language like Ecore, is that the model facilitates making generic tools for manipulating data, including editing it in a user interface. E.g. the type of attributes allows you to automatically select appropriate editing widget in a property sheet and the containment references allows you to add child creation menus containing only the relevant types and support drag & drop which the proper checks for validity.

Creating the instances

Eclipse usually uses wizards to create files, and after creation an appropriate editor is opened. However, while modelling there is no wizard or installed editor, so to create model instances we must use a different mechanism. Both the Sample Ecore Model Editor (default editor for Ecore files) and the Ecore Editor allows you to right-click on an EClass and select Create Dynamic Instance... This will prompt you for the file name, and then it create will create a file with an instance of that EClass in the XMI serialisation format (see Serialization).Image Added

The generic Ecore instance editor

...