You are on page 1of 11

Rubby Casallas

Grupo de Construccin de Software


Uniandes

http://www.eclipse.org/emf/
http://www.eclipsecon.org/2005/presentations/Eclipse
Con2005_Tutorial28.pdf
http://www.eclipsecon.org/2004/EclipseCon_2004_Tec
hnicalTrackPresentations/40_Frankel.pdf
https://doc.telin.nl/dscgi/ds.py/Get/File
- 50548/d4.1.pdf
Eclipse Modeling Framework: A Developer's Guide By
Frank Budinsky, David Steinberg, Ed Merks,
Raymond Ellersick, Timothy J. Grose

EMF is a Java framework and code


generation facility for building tools and other
applications based on a structured model.
Framework to
modeling and data integration
code generation

ECore is:
a meta-language, i.e., a language to define
(structural) models

MOF 2.0
CMOF
EMOF

ECORE

Ecore is a small and simplified subset of full UML.

ECore
with ECore I can
defined my own
model

language to define models (like UML but simpler)


How?
using UML (XMI)
EMF editor
XML Schemas
Annotated java

Using EMF, for my model I


can:
generate java code
create an editor to
instantiate the elements
of my model

When instances of my
model are created, These
can be serialized in XMI

EClass:
represents a modeled class. It has:
a name
zero or more attributes
zero or more references.

EAttribute:
represents a modeled attribute. Attributes have:
a name
a type.

EReference:
represents one end of an association between classes. It
has:
a name,
a boolean flag to indicate if it represents containment,
a reference (target) type, which is another class.

EDataType:
represents the type of an attribute. A data type can be
a primitive type like int or float
an object type like java.util.Date.

genmodel:
provides platform specific details: v.gr. package
names
It is needed to generate code

EMF.model

mymodel.ecore

mymodel.genmodel

Generator

EMF.edit

EMF.editor

EMF.test

A complete implementation of the PIM


Persistence mechanisms on top of XML files

EClass

Java Interface
Java Implementation

public interface PurchaseOrder ...


and a corresponding implementation class:
public class PurchaseOrderImpl extends EObject
implements PurchaseOrder {

introduces three main behaviors:


1. eClass() returns the objects
EClass
Java Interface
metaobject
(an EClass).
2. eContainer() and eResource() return
the objects containing objectJava
and Implementation
resource.
3. eGet(), eSet(), eIsSet(), and eUnset()
provide an API for accessing the
public
interface
PurchaseOrder ...
objects
reflectively.
and a corresponding implementation class:
public class PurchaseOrderImpl extends EObject
implements PurchaseOrder {

The EMF.edit separates the GUI from the


business model
User interface independent implementation of
the interactiondomain

10

The EMF.editor provides the code


SWT/JFace code that directly interacts with
the user

11

You might also like