lramework Rubby Casallas Grupo de Construccin de Software Uniandes Reerences 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 2 \hat is LMl 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 LCore ECore is: a meta-language, i.e., a language to define (structural) models 3 LCore MOF 2.0 EMOF CMOF ECORE Ecore is a small and simplified subset of full UML. \hat is LMl 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 4 \hat is LMl 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 LCore concepts 5 LCore concepts LCore concepts 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. 6 LCore concepts 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. 7 LMl Generator genmodel: provides platform specific details: v.gr. package names It is needed to generate code 1he Generator Model 8 mymodel.ecore mymodel.genmodel Generator EMF.model EMF.edit EMF.editor EMF.test LMl.model A complete implementation of the PIM Persistence mechanisms on top of XML files 9 Mapping to Jaa Java Implementation Java Interface EClass public interface PurchaseOrder ... and a corresponding implementation class: public class PurchaseOrderImpl extends EObject implements PurchaseOrder { 10 Mapping to Jaa Java Implementation Java Interface EClass public interface PurchaseOrder ... and a corresponding implementation class: public class PurchaseOrderImpl extends EObject implements PurchaseOrder { introduces three main behaviors: 1. eClass() returns the objects metaobject (an EClass). 2. eContainer() and eResource() return the objects containing object and resource. 3. eGet(), eSet(), eIsSet(), and eUnset() provide an API for accessing the objects reflectively. LMl.edit The EMF.edit separates the GUI from the business model User interface independent implementation of the interactiondomain 11 LMl.editor The EMF.editor provides the code SWT/JFace code that directly interacts with the user