Information Technology Reference
In-Depth Information
Figure 3.12 presents a subset of the Ecore metamodel.
Ecore prefixes an “E” before all its metaclasses. This helps,
for example, to distinguish between Ecore metaconcepts and
UML metaconcepts. It also makes a distinction between
EAttribute and EReference . The difference is that the type
of an EAttribute is always a primitive type, such as String
or Integer , while the type of an EReference is always an
EClass . Associated EReferences are related to each other
using the eOpposite property.
Figure 3.12. The ecore meta-metamodel
Ecore models, i.e. metamodels that conform to the Ecore
meta-metamodel, can be created in at least three ways: (1)
Java Interfaces, (2) UML-type Class Diagrams and (3) XML
Schemas. Once a model is created using one of the three
different ways, EMF can generate the others. Figure 3.13
presents the EMF editor to create Ecore models using UML-
type Class Diagrams. On the left, a sample Ecore model that
correspondtoapartoftheclassmetamodelshowninFigure3.2
is presented. On the right, the “palette” of options to create
Ecore models is displayed.
EMF also provides facilities to create models that conform
to Ecore models; the syntax is based on a tree structure. A tree
structure is a way to represent the hierarchical nature of a
Search WWH ::




Custom Search