| Free tutorials for Java, Eclipse and Web programming |
Create a new project "de.vogella.emf.webpage.model" via File / New / Project... / Eclipse Modeling Framework /Empty EMF project

Select the folder "model", right click on the folder and select New / Other... / Ecore Tools / Ecore Diagram

Name your "Domain File Name" "webpage.ecore".

This should open a visual editor for creating EMF models.

Open the "Properties" view via Window -> Show View -> Other -> "Properties". This view will allow you to modify the attributes of your model elements.
Click on EClass and click into the editor to create a new class. Create the classes "MyWeb", "Webpage", "Category" and "Article".

Using the EAttribute node assign to each object the atttribute "name" of String "EString".


Add the attributes "title", "description" and "keywords" to "MyWeb" and "Webpage".

We want to use the data type calendar in our model. Select "EDataType" and give it the name "calendar" and type "java.util.Calendar". Add the EAttribute "created" to "Article" and use your new type.

Select EReferences and create an arrow similar to the following picture. Make sure the upper bound is set to "*" and that the "Is Containment" property is flagged.

Close the dialog and open the file "webpage.ecore". The result should look like the following.

Select your "webpage.ecore" -> Select File -> New -> Other -> "EMF Generator model" and create "webpage.genmodel" based on your "Ecore model".



Select your model and press load.

