ecore模型分析
目前生成ecore模型主要由四种途径,如图:

这里我们采用从UML Model产生ecore模型,首先用Rose设计包emf,然后在包中新建如下类图:

生成的ecore模型如下
<?xml version="1.0" encoding="UTF-8"?>
<ecore:EPackage xmi:version="2.0"
xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" name="emf"
nsURI="http:///emf.ecore" nsPrefix="emf">
<eClassifiers xsi:type="ecore:EClass" name="Customer" eSuperTypes="#//Element">
<eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="orders" upperBound="-1"
eType="#//Order" containment="true"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="Order" eSuperTypes="#//Element">
<eStructuralFeatures xsi:type="ecore:EAttribute" name="id" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//ELong"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="price" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EFloat"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="Element" abstract="true">