Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Etienne Borde
www.etienneborde.fr
Objectives
EMF helps to
• Define a common architecture
• Communicate on this architecture
• Produce the code of this architecture
Graphical representation of
• Packages (EPackage)
• EMF data types
Used for
analysis • Classes (EClass), with their attributes (EAttribute)
review and methods (EOperation)
• Inheritence between classes
• References (EReference) between classes
• Enums (EEnum)
• Personalized data types (EDataType)
Packages in Java
Packages (Epackage)
Primitive Data types in EMF
In
a Java program, objects are represented by classes
that describe operations and data contained in this
object.
Classes
(EClass), with their attributes (EAttribute) and
methods (EOperation)
Interfaces,
with their attributes (EAttribute) and
methods (EOperation)
Graphical representation of
• Packages (EPackage)
• EMF data types
• Classes (EClass), with their attributes (EAttribute)
and methods (EOperation)
Used for • Inheritence between classes
specification
review • References (EReference) between classes
• Enums (EEnum)
• Personalized data types (EDataType)
Enumerated data type (enum)
Reference
mail and destination can be set as
EOpposite:
EOpposite reference, good consequence
In Eclipse,
• Go to Help --> Install New Software
• Click on "Add »
• Fill in the form
Name: Juno
Location: http://download.eclipse.org/releases/juno
• Then select "Juno" for "work with"
• Extend the menu "Modeling" and select
"Ecore Tools SDK" and
"EMF - Eclipse Modeling Framework SDK".
• Click on "Next" then "Finish ».
Practical advice:
• Create one EMF model for the whole system, to be defined all
together
• Create one EMF model per subsystem, or component, so that
only 2 students are working together on a model
Select the element you want to change the color, and go to the property view.
Then click on the painting sign and select the color
Fill
in the name of the file, then select ecore as type of
importation
Create .genmodel file
“everything”
is in the property view
• When you select a package of in the genmodel content,
fill in:
• The value of this property will tell EMF which prefix to use
to generated Java Packages
Code generation actions
Right-click
on the root of the
genmodel tree, click on Generate
All
Result of the code generation
protected SortingCenterImpl() {
super();
}
Once generated
• Should be put under version control (Git) in order to
avoid systematic regeneration of code by all the users.
• The EMF model should not be modified anymore…
In
other words, EMF is not supposed to be used
during the implementation phase.
Sources of information