SlideShare une entreprise Scribd logo
1  sur  55
Fundamentals of the Eclipse Modeling Framework Dave Steinberg IBM Rational Software Toronto, Canada EMF Project Committer
Goal ,[object Object]
Agenda ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Model Driven Architecture (MDA) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
MDA – Are We There Yet? ,[object Object],[object Object],[object Object],[object Object]
Enter EMF! ,[object Object],[object Object],[object Object],[object Object]
Model Driven Development with EMF ,[object Object],[object Object],[object Object],[object Object],[object Object]
What Does EMF Provide? ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
EMF and Java 5.0 ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
EMF at Eclipse.org ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Agenda ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
What is an EMF “Model”? ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Model Sources ,[object Object],[object Object],[object Object],[object Object],[object Object]
Java Interfaces ,[object Object],public interface  PurchaseOrder { String  getShipTo (); void setShipTo(String value); String  getBillTo (); void setBillTo(String value); List<Item>  getItems ();  // containment } public interface  Item { String  getProductName (); void setProductName(String value); int  getQuantity (); void setQuantity(int value) float  getPrice (); void setPrice(float value); }
UML Class Diagram ,[object Object],[object Object]
XML Schema <?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?> <xsd:schema xmlns:xsd=&quot;http://www.w3.org/2001/XMLSchema&quot; targetNamespace=&quot;http://www.example.com/SimplePO&quot; xmlns:PO=&quot;http://www.example.com/SimplePO&quot;> <xsd:complexType name=&quot; PurchaseOrder &quot;> <xsd:sequence> <xsd:element name=&quot; shipTo &quot; type=&quot;xsd:string&quot;/> <xsd:element name=&quot; billTo &quot; type=&quot;xsd:string&quot;/> <xsd:element name=&quot; items &quot;  type=&quot;PO:Item&quot;  minOccurs=&quot;0&quot; maxOccurs=&quot;unbounded&quot;/> </xsd:sequence> </xsd:complexType> <xsd:complexType name=&quot; Item &quot;> <xsd:sequence> <xsd:element name=&quot; productName &quot; type=&quot;xsd:string&quot;/> <xsd:element name=&quot; quantity &quot; type=&quot;xsd:int&quot;/> <xsd:element name=&quot; price &quot; type=&quot;xsd:float&quot;/> </xsd:sequence> </xsd:complexType> </xsd:schema>
Unifying UML, XML and Java ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Agenda ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Ecore ,[object Object]
Ecore ,[object Object],EClass (name=&quot;PurchaseOrder&quot;) EClass (name=&quot;Item&quot;) EAttribute (name=&quot;shipTo&quot;) EAttribute (name=&quot;billTo&quot;) EReference (name=&quot;items&quot;) eReferenceType EAttribute (name=“productName&quot;)
Ecore ,[object Object],[object Object],<eClassifiers xsi:type=&quot;ecore:EClass&quot; name=&quot; PurchaseOrder &quot;> <eStructuralFeatures xsi:type=&quot;ecore:EReference&quot; name=&quot; items &quot; eType=&quot;#//Item&quot;  upperBound=&quot;-1&quot; containment=&quot;true&quot;/> <eStructuralFeatures xsi:type=&quot;ecore:EAttribute&quot; name=&quot; shipTo &quot;  eType=&quot;ecore:EDataType http:...Ecore#//EString&quot;/> ... </eClassifiers>
Model Import and Generation ,[object Object],[object Object],[object Object],[object Object],Ecore Model UML XML  Schema Java Model I M P O R T Java Edit Java Editor GENERATE
Agenda ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Generated Model Code ,[object Object],[object Object],public interface  PurchaseOrder  extends EObject { String getShipTo(); void setShipTo(String value); String getBillTo(); void setBillTo(String value); EList<Item> getItems(); } public class  PurchaseOrderImpl  extends EObjectImpl implements PurchaseOrder { ... }
Feature Accessors: Change Notification ,[object Object],[object Object],public String getShipTo() { return shipTo; } public void setShipTo(String newShipTo) { String oldShipTo = shipTo; shipTo = newShipTo; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, ... ); }
Bidirectional Reference Handshaking public interface  PurchaseOrder { ... PurchaseOrder  getNext (); void  setNext (PurchaseOrder value); PurchaseOrder  getPrevious (); void  setPrevious (PurchaseOrder value); } Bidirectional reference imposes invariant:  po.getNext().getPrevious() == po
Bidirectional Reference Handshaking ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Bidirectional Reference Handshaking p1.setNext(p3); p2 p1 p2 p3 change notification  previous next previous next next previous next previous
Reflective EObject API ,[object Object],[object Object],[object Object],[object Object],public interface EObject { Object eGet(EStructuralFeature sf); void eSet(EStructuralFeature sf, Object val); }
Reflective EObject API ,[object Object],public Object eGet(int featureID, ...) { switch (featureID) { case POPackage.PURCHASE_ORDER__ITEMS: return getItems(); case POPackage.PURCHASE_ORDER__SHIP_TO: return getShipTo(); case POPackage.PURCHASE_ORDER__BILL_TO: return getBillTo(); ... } ... }
Typesafe Enums ,[object Object],public  enum  Status implements Enumerator { PENDING(0, &quot;Pending&quot;, &quot;Pending&quot;), BACK_ORDER(1, &quot;BackOrder&quot;, &quot;BackOrder&quot;), COMPLETE(2, &quot;Complete&quot;, &quot;Complete&quot;); public static final int PENDING_VALUE = 0; public static final int BACK_ORDER_VALUE = 1; public static final int COMPLETE_VALUE = 2; private final int value; private final String name; private final String literal; private Status(int value, String name, String literal) { ... } ... }
Other Generated Artifacts ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
[object Object],[object Object],[object Object],Regeneration and Merge /** * <!-- begin-user-doc --> * <!-- end-user-doc --> *  @generated */ public String getName() { return name; }
[object Object],Regeneration and Merge public String  getName () { return format(getNameGen()); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> *  @generated */ public String  getNameGen () { return name; }
Agenda ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Model Persistence ,[object Object],[object Object],[object Object]
Resource Implementations ,[object Object],[object Object],resource = resourceSet.createResource(...&quot;p1.xml&quot;...); resource.getContents().add(p1); resource.save(...); <PurchaseOrder> <shipTo> John Doe </shipTo> <next> p2.xml#p2 </next> </PurchaseOrder> p1.xml:
Proxy Resolution and Demand Load proxyURI=&quot;p2.xml#p2&quot; proxyURI=&quot; p2.xml #p2&quot; p1 p1.xml PurchaseOrder p2 = p1.getNext(); next p2 p2.xml next
Change Notification ,[object Object],[object Object],[object Object],[object Object],[object Object],Adapter adapter = ... purchaseOrder.eAdapters().add(adapter);
Reflection ,[object Object],[object Object],PurchaseOrder po = ... po. setBillTo (&quot;123 Elm St.&quot;); EObject po = ...  EClass poClass = po.eClass(); po. eSet (poClass.getEStructuralFeature(&quot;billTo&quot;), &quot;123 Elm St.&quot;);
Dynamic EMF ,[object Object],[object Object],[object Object],[object Object],[object Object]
Change Recording ,[object Object]
Change Recording ,[object Object],[object Object],[object Object],ChangeRecorder changeRecorder = new ChangeRecorder(resourceSet); try { // modifications within resource set } catch (Exception e) { changeRecorder.endRecording().apply(); }
Validation ,[object Object],[object Object],[object Object],[object Object],[object Object],Diagnostianostic diagnostic = Diagnostician.INSTANCE.validate(eObject); if (diagnostic.getSeverity() == Diagnostic.ERROR) ...
Agenda ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Relational Persistence ,[object Object],[object Object],[object Object],[object Object]
Teneo ,[object Object],[object Object],[object Object],[object Object]
Teneo Hibernate O/R Mapping ,[object Object],[object Object],[object Object],HbDataStore ds = HbHelper.INSTANCE.createRegisterDataStore(&quot;POStore&quot;); ds.setEPackages(new EPackage[] { POPackage.eINSTANCE }); ds.initialize();
Teneo Hibernate Integration ,[object Object],[object Object],SessionFactory sf = ds.getSessionFactory(); Session session = sf.openSession(); session.beginTransaction(); List orders = session.createQuery(&quot;FROM PurchaseOrder&quot;).list(); ((PurchaseOrder)orders.get(0)).setShipTo(&quot;123 Elm St.&quot;); session.getTransaction().commit(); session.close();
Teneo Hibernate Resource ,[object Object],[object Object],URI uri = URI.createURI(&quot;hibernate://?dsname=POStore&quot;); Resource resource = resourceSet.createResource(uri); resource.getContents().add(po); resource.save(null);
Agenda ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Agenda ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Summary ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Resources ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Legal Notices IBM, Rational, and Rational Rose are registered trademarks of International Business Machines Corp. in the United States, other countries, or both. Java and all Java-based trademarks are trademarks of Sun Microsystems, Inc. in the United States, other countries, or both.  Other company, product, or service names may be trademarks or service marks of others.

Contenu connexe

Tendances

Development of forms editors based on Ecore metamodels
Development of forms editors based on Ecore metamodelsDevelopment of forms editors based on Ecore metamodels
Development of forms editors based on Ecore metamodels
Mario Cervera
 
Eqela Core API and Utilities
Eqela Core API and UtilitiesEqela Core API and Utilities
Eqela Core API and Utilities
jobandesther
 
11 ooad uml-14
11 ooad uml-1411 ooad uml-14
11 ooad uml-14
Niit Care
 
Graphical User Interface Development with Eqela
Graphical User Interface Development with EqelaGraphical User Interface Development with Eqela
Graphical User Interface Development with Eqela
jobandesther
 
C programming session 08
C programming session 08C programming session 08
C programming session 08
AjayBahoriya
 
Introduction to Eqela development
Introduction to Eqela developmentIntroduction to Eqela development
Introduction to Eqela development
jobandesther
 

Tendances (20)

UML as a Programming Language
UML as a Programming LanguageUML as a Programming Language
UML as a Programming Language
 
Sprouting into the world of Elm
Sprouting into the world of ElmSprouting into the world of Elm
Sprouting into the world of Elm
 
Unit 7 Java
Unit 7 JavaUnit 7 Java
Unit 7 Java
 
UML Modeling and Profiling Lab - Advanced Software Engineering Course 2014/2015
UML Modeling and Profiling Lab - Advanced Software Engineering Course 2014/2015UML Modeling and Profiling Lab - Advanced Software Engineering Course 2014/2015
UML Modeling and Profiling Lab - Advanced Software Engineering Course 2014/2015
 
Metamodeling - Advanced Software Engineering Course 2014/2015
Metamodeling - Advanced Software Engineering Course 2014/2015Metamodeling - Advanced Software Engineering Course 2014/2015
Metamodeling - Advanced Software Engineering Course 2014/2015
 
Development of forms editors based on Ecore metamodels
Development of forms editors based on Ecore metamodelsDevelopment of forms editors based on Ecore metamodels
Development of forms editors based on Ecore metamodels
 
java programming - applets
java programming - appletsjava programming - applets
java programming - applets
 
fUML-Driven Design and Performance Analysis of Software Agents for Wireless S...
fUML-Driven Design and Performance Analysis of Software Agents for Wireless S...fUML-Driven Design and Performance Analysis of Software Agents for Wireless S...
fUML-Driven Design and Performance Analysis of Software Agents for Wireless S...
 
L09 Frameworks
L09 FrameworksL09 Frameworks
L09 Frameworks
 
Eqela Core API and Utilities
Eqela Core API and UtilitiesEqela Core API and Utilities
Eqela Core API and Utilities
 
11 ooad uml-14
11 ooad uml-1411 ooad uml-14
11 ooad uml-14
 
Software design patterns ppt
Software design patterns pptSoftware design patterns ppt
Software design patterns ppt
 
Graphical User Interface Development with Eqela
Graphical User Interface Development with EqelaGraphical User Interface Development with Eqela
Graphical User Interface Development with Eqela
 
C programming session 08
C programming session 08C programming session 08
C programming session 08
 
Introduction to Eqela development
Introduction to Eqela developmentIntroduction to Eqela development
Introduction to Eqela development
 
Software Design Patterns
Software Design PatternsSoftware Design Patterns
Software Design Patterns
 
Object-Oriented Application Frameworks
Object-Oriented Application FrameworksObject-Oriented Application Frameworks
Object-Oriented Application Frameworks
 
Uml Diagrams for Web Developers
Uml Diagrams for Web DevelopersUml Diagrams for Web Developers
Uml Diagrams for Web Developers
 
S313937 cdi dochez
S313937 cdi dochezS313937 cdi dochez
S313937 cdi dochez
 
Go f designpatterns 130116024923-phpapp02
Go f designpatterns 130116024923-phpapp02Go f designpatterns 130116024923-phpapp02
Go f designpatterns 130116024923-phpapp02
 

En vedette

MoDisco EclipseCon2010
MoDisco EclipseCon2010MoDisco EclipseCon2010
MoDisco EclipseCon2010
fmadiot
 
Industrial and Academic Experiences with a User Interaction Modeling Language...
Industrial and Academic Experiences with a User Interaction Modeling Language...Industrial and Academic Experiences with a User Interaction Modeling Language...
Industrial and Academic Experiences with a User Interaction Modeling Language...
Marco Brambilla
 
Real world DSL - making technical and business people speaking the same language
Real world DSL - making technical and business people speaking the same languageReal world DSL - making technical and business people speaking the same language
Real world DSL - making technical and business people speaking the same language
Mario Fusco
 
IFML - The interaction flow modeling language, the OMG standard for UI modeli...
IFML - The interaction flow modeling language, the OMG standard for UI modeli...IFML - The interaction flow modeling language, the OMG standard for UI modeli...
IFML - The interaction flow modeling language, the OMG standard for UI modeli...
Marco Brambilla
 
Model-Driven Software Engineering in Practice - Chapter 1 - Introduction
Model-Driven Software Engineering in Practice - Chapter 1 - IntroductionModel-Driven Software Engineering in Practice - Chapter 1 - Introduction
Model-Driven Software Engineering in Practice - Chapter 1 - Introduction
Marco Brambilla
 

En vedette (16)

EMF Compare 2.0: Scaling to Millions (updated)
EMF Compare 2.0: Scaling to Millions (updated)EMF Compare 2.0: Scaling to Millions (updated)
EMF Compare 2.0: Scaling to Millions (updated)
 
MoDisco EclipseCon2010
MoDisco EclipseCon2010MoDisco EclipseCon2010
MoDisco EclipseCon2010
 
Textual Modeling Framework Xtext
Textual Modeling Framework XtextTextual Modeling Framework Xtext
Textual Modeling Framework Xtext
 
Acceleo Code Generation
Acceleo Code GenerationAcceleo Code Generation
Acceleo Code Generation
 
You need to extend your models? EMF Facet vs. EMF Profiles
You need to extend your models? EMF Facet vs. EMF ProfilesYou need to extend your models? EMF Facet vs. EMF Profiles
You need to extend your models? EMF Facet vs. EMF Profiles
 
Industrial and Academic Experiences with a User Interaction Modeling Language...
Industrial and Academic Experiences with a User Interaction Modeling Language...Industrial and Academic Experiences with a User Interaction Modeling Language...
Industrial and Academic Experiences with a User Interaction Modeling Language...
 
The Unbearable Stupidity of Modeling
The Unbearable Stupidity of ModelingThe Unbearable Stupidity of Modeling
The Unbearable Stupidity of Modeling
 
Eugenia
EugeniaEugenia
Eugenia
 
Domain-Specific Languages
Domain-Specific LanguagesDomain-Specific Languages
Domain-Specific Languages
 
Introducing MDSD
Introducing MDSDIntroducing MDSD
Introducing MDSD
 
Real world DSL - making technical and business people speaking the same language
Real world DSL - making technical and business people speaking the same languageReal world DSL - making technical and business people speaking the same language
Real world DSL - making technical and business people speaking the same language
 
IFML - The interaction flow modeling language, the OMG standard for UI modeli...
IFML - The interaction flow modeling language, the OMG standard for UI modeli...IFML - The interaction flow modeling language, the OMG standard for UI modeli...
IFML - The interaction flow modeling language, the OMG standard for UI modeli...
 
Model-Driven Software Engineering in Practice - Chapter 1 - Introduction
Model-Driven Software Engineering in Practice - Chapter 1 - IntroductionModel-Driven Software Engineering in Practice - Chapter 1 - Introduction
Model-Driven Software Engineering in Practice - Chapter 1 - Introduction
 
MDD - Desarrollo de software dirigido por modelos que funciona (de verdad!)
MDD - Desarrollo de software dirigido por modelos que funciona (de verdad!)MDD - Desarrollo de software dirigido por modelos que funciona (de verdad!)
MDD - Desarrollo de software dirigido por modelos que funciona (de verdad!)
 
ATL tutorial - EclipseCon 2008
ATL tutorial - EclipseCon 2008ATL tutorial - EclipseCon 2008
ATL tutorial - EclipseCon 2008
 
OCL tutorial
OCL tutorial OCL tutorial
OCL tutorial
 

Similaire à Eclipse World 2007: Fundamentals of the Eclipse Modeling Framework

Model-Driven Development in the context of Software Product Lines
Model-Driven Development in the context of Software Product LinesModel-Driven Development in the context of Software Product Lines
Model-Driven Development in the context of Software Product Lines
Markus Voelter
 

Similaire à Eclipse World 2007: Fundamentals of the Eclipse Modeling Framework (20)

EclipseCon 2007: Effective Use of the Eclipse Modeling Framework
EclipseCon 2007: Effective Use of the Eclipse Modeling FrameworkEclipseCon 2007: Effective Use of the Eclipse Modeling Framework
EclipseCon 2007: Effective Use of the Eclipse Modeling Framework
 
EMF - The off beat path
EMF - The off beat pathEMF - The off beat path
EMF - The off beat path
 
MODEL DRIVEN ARCHITECTURE, CONTROL SYSTEMS AND ECLIPSE
MODEL DRIVEN ARCHITECTURE, CONTROL SYSTEMS AND ECLIPSEMODEL DRIVEN ARCHITECTURE, CONTROL SYSTEMS AND ECLIPSE
MODEL DRIVEN ARCHITECTURE, CONTROL SYSTEMS AND ECLIPSE
 
EGL Conference 2011 - EGL Open
EGL Conference 2011 - EGL OpenEGL Conference 2011 - EGL Open
EGL Conference 2011 - EGL Open
 
Dynamic and Generic Manipulation of Models: From Introspection to Scripting
Dynamic and Generic Manipulation of Models: From Introspection to ScriptingDynamic and Generic Manipulation of Models: From Introspection to Scripting
Dynamic and Generic Manipulation of Models: From Introspection to Scripting
 
EMF-REST: Generation of RESTful APIs from Models
EMF-REST: Generation of RESTful APIs from ModelsEMF-REST: Generation of RESTful APIs from Models
EMF-REST: Generation of RESTful APIs from Models
 
ALT
ALTALT
ALT
 
MDE=Model Driven Everything (Spanish Eclipse Day 2009)
MDE=Model Driven Everything (Spanish Eclipse Day 2009)MDE=Model Driven Everything (Spanish Eclipse Day 2009)
MDE=Model Driven Everything (Spanish Eclipse Day 2009)
 
Choose'10: Ralf Laemmel - Dealing Confortably with the Confusion of Tongues
Choose'10: Ralf Laemmel - Dealing Confortably with the Confusion of TonguesChoose'10: Ralf Laemmel - Dealing Confortably with the Confusion of Tongues
Choose'10: Ralf Laemmel - Dealing Confortably with the Confusion of Tongues
 
Effective JavaFX architecture with FxObjects
Effective JavaFX architecture with FxObjectsEffective JavaFX architecture with FxObjects
Effective JavaFX architecture with FxObjects
 
Model-Driven Development in the context of Software Product Lines
Model-Driven Development in the context of Software Product LinesModel-Driven Development in the context of Software Product Lines
Model-Driven Development in the context of Software Product Lines
 
iPhone development from a Java perspective (Jazoon '09)
iPhone development from a Java perspective (Jazoon '09)iPhone development from a Java perspective (Jazoon '09)
iPhone development from a Java perspective (Jazoon '09)
 
Modeling With Eclipse @SoftShake 2011
Modeling With Eclipse @SoftShake 2011Modeling With Eclipse @SoftShake 2011
Modeling With Eclipse @SoftShake 2011
 
Module design pattern i.e. express js
Module design pattern i.e. express jsModule design pattern i.e. express js
Module design pattern i.e. express js
 
Eclipse e4 Overview
Eclipse e4 OverviewEclipse e4 Overview
Eclipse e4 Overview
 
Eclipse e4 on Java Forum Stuttgart 2010
Eclipse e4 on Java Forum Stuttgart 2010Eclipse e4 on Java Forum Stuttgart 2010
Eclipse e4 on Java Forum Stuttgart 2010
 
Eclipse 40 and Eclipse e4
Eclipse 40 and Eclipse e4 Eclipse 40 and Eclipse e4
Eclipse 40 and Eclipse e4
 
Pragmatic Model Driven Development using openArchitectureWare
Pragmatic Model Driven Development using openArchitectureWarePragmatic Model Driven Development using openArchitectureWare
Pragmatic Model Driven Development using openArchitectureWare
 
Overview of CSharp MVC3 and EF4
Overview of CSharp MVC3 and EF4Overview of CSharp MVC3 and EF4
Overview of CSharp MVC3 and EF4
 
OCL'16 slides: Models from Code or Code as a Model?
OCL'16 slides: Models from Code or Code as a Model?OCL'16 slides: Models from Code or Code as a Model?
OCL'16 slides: Models from Code or Code as a Model?
 

Dernier

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Dernier (20)

Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot ModelNavi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 

Eclipse World 2007: Fundamentals of the Eclipse Modeling Framework

  • 1. Fundamentals of the Eclipse Modeling Framework Dave Steinberg IBM Rational Software Toronto, Canada EMF Project Committer
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.
  • 14.
  • 15.
  • 16. XML Schema <?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?> <xsd:schema xmlns:xsd=&quot;http://www.w3.org/2001/XMLSchema&quot; targetNamespace=&quot;http://www.example.com/SimplePO&quot; xmlns:PO=&quot;http://www.example.com/SimplePO&quot;> <xsd:complexType name=&quot; PurchaseOrder &quot;> <xsd:sequence> <xsd:element name=&quot; shipTo &quot; type=&quot;xsd:string&quot;/> <xsd:element name=&quot; billTo &quot; type=&quot;xsd:string&quot;/> <xsd:element name=&quot; items &quot; type=&quot;PO:Item&quot; minOccurs=&quot;0&quot; maxOccurs=&quot;unbounded&quot;/> </xsd:sequence> </xsd:complexType> <xsd:complexType name=&quot; Item &quot;> <xsd:sequence> <xsd:element name=&quot; productName &quot; type=&quot;xsd:string&quot;/> <xsd:element name=&quot; quantity &quot; type=&quot;xsd:int&quot;/> <xsd:element name=&quot; price &quot; type=&quot;xsd:float&quot;/> </xsd:sequence> </xsd:complexType> </xsd:schema>
  • 17.
  • 18.
  • 19.
  • 20.
  • 21.
  • 22.
  • 23.
  • 24.
  • 25.
  • 26. Bidirectional Reference Handshaking public interface PurchaseOrder { ... PurchaseOrder getNext (); void setNext (PurchaseOrder value); PurchaseOrder getPrevious (); void setPrevious (PurchaseOrder value); } Bidirectional reference imposes invariant: po.getNext().getPrevious() == po
  • 27.
  • 28. Bidirectional Reference Handshaking p1.setNext(p3); p2 p1 p2 p3 change notification previous next previous next next previous next previous
  • 29.
  • 30.
  • 31.
  • 32.
  • 33.
  • 34.
  • 35.
  • 36.
  • 37.
  • 38. Proxy Resolution and Demand Load proxyURI=&quot;p2.xml#p2&quot; proxyURI=&quot; p2.xml #p2&quot; p1 p1.xml PurchaseOrder p2 = p1.getNext(); next p2 p2.xml next
  • 39.
  • 40.
  • 41.
  • 42.
  • 43.
  • 44.
  • 45.
  • 46.
  • 47.
  • 48.
  • 49.
  • 50.
  • 51.
  • 52.
  • 53.
  • 54.
  • 55. Legal Notices IBM, Rational, and Rational Rose are registered trademarks of International Business Machines Corp. in the United States, other countries, or both. Java and all Java-based trademarks are trademarks of Sun Microsystems, Inc. in the United States, other countries, or both. Other company, product, or service names may be trademarks or service marks of others.

Notes de l'éditeur

  1. Welcome…
  2. I hope to help you learn about modeling and convince you that EMF can help you write just about any application in significantly less time, simply by leveraging the data model you’ve probably already defined (even though you might not know it yet).
  3. Here’s our agenda. I’ll start with some philosophy…
  4. What is modeling? The Object Management Group, an industry consortium, has tried to answer that question by proposing MDA – Model Driven Architecture…
  5. MDA initiative began in 2001. Some people are wondering not just “are we there yet?” but “are we ever going to get there?”…
  6. This is the environment in which EMF was introduced and took hold…
  7. EMF’s take is that models are everywhere, and we just need to find them, extract them, and leverage them…
  8. How? With all this…
  9. Also, as of last summer’s Europa release, EMF provides support for Java 5.0… Generics support includes the ability to model generic types within Ecore.
  10. Where does EMF fit into the Eclipse “big picture”? EMF was one of the first projects at Eclipse outside of the Eclipse Project itself, starting in 2002 as part of the Tools project. Since then, the modeling project has formed around it…
  11. Now, let’s talk some more about models in EMF: what they consist of and where they come from.
  12. I’ve mentioned that EMF’s view of modeling favours simplicity over expressiveness. But, to be more concrete, here’s what we mean by a “model” in EMF…
  13. EMF is very much intended to be a unifying technology. It expects models to be expressed in any number of different ways, and aims to extract its core view of the model from those different representations. Out of the box, it supports what we consider to be the most important ones…  To dwell for a moment on the notion of equivalence of different model representations, let’s consider a simple, familiar example. Imagine we wanted to represent the data in a purchase order. The non-modeler would probably start by writing some Java interfaces…
  14. An interface for each type, accessors for each attribute or association (reference). This really is a definition of the model. Sometimes, we’d like to express things that aren’t captured in these signatures…
  15. A graphical representation of the model is more concise. Here, we’re using UML notation…
  16. There’s another important way of coming at this: by asking “how do we want to instances of the model to look when they’re serialized?” That’s what XML Schema is all about… Notice that there’s additional information in this one…
  17. To reiterate, these different forms all provide the same core information about the model, or structure, of the application’s data. EMF allows you to capture this information and use it to, among other things, generate code.
  18. Let’s turn to EMF’s architecture. If EMF’s purpose is to capture the core information about an application’s data model, the big question is how…
  19. Not surprisingly, it uses a model… Here is a simplified picture…
  20. The way EMF defines your application model, such as the purchase order we discussed previously, is by instantiating Ecore…
  21. Ecore is persisted as XML, using the OMG’s standard for metadata serialization, XML Metadata Interchange… EMOF is the OMG’s equivalent to Ecore. Based on experience with EMF, MOF was split into to two layers, where EMOF is the minimal core. Because of their similarity, EMF directly supports saving Ecore as EMOF XMI and loading EMOF XMI into Ecore.
  22. Here’s the pretty block diagram that will hopefully tie everything together…
  23. I’ve mentioned more than once that EMF lets you generate code from a model. But what does that code look like?
  24. First off, for each modeled class, an interface/implementation pair are generated. Notice that the interface looks like the Java model representation… Using interfaces allows us support for multiple inheritance… Interfaces extend EObject, the EMF equivalent of java.lang.Object…
  25. Looking in the implementation class at the accessors, we see an almost minimal implementation…
  26. Things get a bit more complicated if you model bidirectional associations, in order to ensure that referential integrity is maintained. To illustrate…
  27. EMF implements this using a handshaking pattern… It’s not possible to turn off this handshaking bahvior or stop it part-way, without significantly altering generated code.
  28. Now, looking at the example, let’s follow the whole handshaking process. If we have three purchase orders arranged like this…
  29. Earlier, I mentioned the EObject interface. Primarily, it provides the API for manipulating objects reflectively…
  30. These generic accessor methods are implemented using an efficient switch, so as to only impose a small constant-time overhead… Metadata in EMF is represented in two ways…
  31. EMF realizes enumerated types with Java 5 enums. Previously, a class-based type-safe enum pattern was used.
  32. Obviously, there’s not enough time to talk about every artifact that EMF generates, so here’s a quick list. Notice that the code is divided into four projects…
  33. As I mentioned in the intro, Ecore is simple by design. Instead of trying to provide a modeling vocabulary that’s as expressive as Java…
  34. The generator also supports a pattern for extending generated methods, analogous to overriding a method in a subclass…
  35. Let’s talk about how you can use all this code we generated…
  36. We’ll start with EMF’s resource-based persistence framework. A resource in EMF is a container for a bunch of objects that will be persisted together. A resource set provides a context for multiple.. Demand-loading is used for cross-resource references…
  37. Out of the box, EMF provides a generic XML resource and a number of different specializations of it…
  38. To expand on EMF’s demand-load model for cross-resource references, let’s look at another simple example…
  39. Switching gears, a few words on notification. As we saw when we were discussing generated setter implementations, change notification is built in…
  40. The reflective EObject interface is a powerful mechanism for data integration, as it allows your application to discover the model for objects at runtime and modify them accordingly. If you know the model ahead of time…
  41. Built upon the reflective API is dynamic EMF. Rather than generating code, you can define an Ecore model at runtime and instantiate it immediately, using a generic implementation. All of the behaviours of the generated code are emulated by this implementation. You can define the model…
  42. EMF provides a facility for representing and recording changes to data. As we’re big believers in eating our own dog food…
  43. A change recorder is a special adapter that attaches to an entire content tree and, based on the change notifications it receives…
  44. The EMF core also has a built-in framework for validation of invariants and constraints… The API for invoking validation is the Diagnostician class…
  45. As I mentioned at the beginning of the talk, the modeling project is building a whole stack of technologies on top of EMF. I thought that, for this audience in particular…
  46. There are two emerging technologies in the EMFT project that provide support for database persistence in EMF…
  47. I’m going to focus on Teneo today, just because of time pressures and because I’m more familiar with it… … with plans to include EclipseLink. It also allows you to use ordinary, unchanged generated model implementations…
  48. I’ll focus on Hibernate just because it seems to be more popular, but the capabilities and APIs for JPOX are very much analgous… A Hibernate data store manages the O/R mapping and, in fact, creates it automatically at runtime…
  49. The data store then provides a session factory, which can be used in typical Hibernate transactions…
  50. Alternately, Teneo provides a Hibernate resource implementation, allowing you to use the ordinary EMF persistence API…