SlideShare a Scribd company logo
Developing a new
EMC Driver for Eclipse Epsilon
Ionut Predoaia
Eclipse Epsilon Architecture
2
EMC Drivers
• the Epsilon Model Connectivity (EMC) layer provides abstraction facilities
over concrete modelling technologies (EMF, XML, Simulink)
• enables Epsilon programs to interact with models conforming to these
technologies in a uniform manner
• EMC makes minimal assumptions about the structure and the organization
of the underlying modelling technologies
• it intentionally refrains from defining classes for concepts such as model
element, type and metamodel
• more resistant to future changes in the implementations of the current
technologies and can also embrace new technologies without changes
3
Implementation of EMC drivers
Two Eclipse plugins:
➢Implementation of the driver’s Eclipse-based development tools
org.eclipse.epsilon.emc.XX.dt
➢Implementation of the EMC driver
org.eclipse.epsilon.emc.XX
where XX stands for the metamodeling technology used (e.g., EMF, XML, CSV)
4
Eclipse-based development tools
• provide a dialog to configure models conforming to the new
metamodeling technology
5
Implementation of Configuration Dialog
• standard implementation (100 lines of code)
Examples: CSV driver, Plain XML driver
• minimal SWT knowledge required
• dialog class extends
❑AbstractCachedModelConfigurationDialog
❑AbstractModelConfigurationDialog
6
Configuration Dialog class
extends AbstractCachedModelConfigurationDialog
7
Configuration Dialog class
extends AbstractCachedModelConfigurationDialog
8
Configuration Dialog class
AbstractModelConfigurationDialog
9
Configuration Dialog class
AbstractCachedModelConfigurationDialog
10
Configuration Dialog class
AbstractModelConfigurationDialog
11
Configuration Dialog class
extends AbstractCachedModelConfigurationDialog
12
Configuration Dialog class
extends AbstractCachedModelConfigurationDialog
13
Configuration Dialog class
Storing properties
14
Configuration Dialog: Exercises
1. Modify the model name
2. Add a new group in the dialog (text field and checkbox)
15
Implementation of EMC drivers
Two Eclipse plugins:
➢Implementation of the driver’s Eclipse-based development tools
org.eclipse.epsilon.emc.XX.dt
➢Implementation of the EMC driver
org.eclipse.epsilon.emc.XX
where XX stands for the metamodeling technology used (e.g., EMF, XML, CSV)
16
Implementation of the EMC driver
Three classes are required:
• a class for defining the model
❑ implements IModel
• a Property Getter class for the model
❑ implements IPropertyGetter
• a Property Setter class for the model
❑ implements IPropertySetter
17
Implementation of the EMC driver
18
Class for defining the model
Extend/implement one of the following:
• IModel
• Model
• CachedModel<ModelElementType> (recommended)
…
19
Class for defining the model (CachedModel)
• identify what is a model element in your modelling language:
❑ XML : Element ⟶ CachedModel<Element>
❑ CSV : Map ⟶ CachedModel<Map<String, Object>>
❑ YAML : Entry ⟶ CachedModel<Entry>
• the methods from IModel must be parameterised using the identified
model element type
20
Class for defining the model
Examples:
• CSV driver
• Plain XML driver
• YAML driver
• Simulink driver
21
Hook Model to Epsilon
• we need to inform Epsilon that there is a new model type available:
❑ the name of the model type
❑ the class of the new model
❑ the configuration dialog of the new model
❑ an icon for the launch dialog
• use the Extension Point: org.eclipse.epsilon.common.dt.modelType
• added using MANIFEST.MF (Extension tab)
22
Hook Model to Epsilon
23
Implementing IModel : load()
• loads the model in memory from storage
• the properties from the Configuration Dialog are
passed in the properties parameter of the load
method
• initializes the required data and parameters
24
Implementing IModel : loadModel()
• loads in memory the selected model in the Configuration Dialog
• ideally, it should set up a data structure that keeps track of
instantiated model elements
25
Implementing IModel : disposeModel()
• executes clean-up code for releasing model resources
26
Implementing IModel : store()
• persists the in-memory representation of the model to a storage location
• the method is executed only when the value of the property Store on disposal is true
27
Implementing IModel : isLoaded()
• returns true if the model is loaded in memory
28
Implementing IModel : isModelElement()
• returns true if an instance is a model element
• this is usually done by comparing the type of the instance with the
type of the model element
29
Types and Kinds
• the type-of relationship appears when a model element is an instance
of a type
• the kind-of relationship appears when the model element is an
instance of a type or any of its sub-types
Examples:
➢ s_{nodeName} for scalar nodes
➢ m_{nodeName} for mapping nodes
➢ l_{nodeName} for list nodes
30
Implementing IModel : getTypeOf()
• returns the fully-qualified name of the type of a model element
(instance)
• the type represents the class of the model element
• CachedModel<ModelElementType>
31
Implementing IModel : getTypeNameOf()
• returns the type name of a model element (instance)
• the type name is used for caching purposes
32
Implementing IModel : getAllTypeNamesOf()
• returns an immutable set over the type name of a single model
element instance
33
Implementing IModel : getCacheKeyForType()
• the returned string is the type
• used as a key for caching model elements by type
34
Implementing IModel : hasType()
• returns true if the model supports a type with the specified name
(e.g., s_role, m_city, t_book)
35
Implementing IModel : isInstantiable()
• returns true if instances of the type can be created
• it is usually based on the method hasType()
36
Implementing IModel : creating instances
• create a new model element instance of a specific type and return it
• add the created instance to the list of created instances
37
Implementing IModel : deleting instances
• delete the model element instance from the in-memory
representation of the model
• delete the model element instance from the list of created instances
38
Implementing IModel : owns()
• returns true if the model element instance is contained within the in-
memory representation of the model or in the list of created instances
39
Implementing IModel : allContentsFromModel()
• returns the entire content of the model, i.e., all model elements
40
Implementing IModel : getAllOfTypeFromModel()
• returns all model elements with the specified type
41
Implementing IModel : getAllOfKindFromModel()
• returns all model elements with the specified kind
• in many cases the kind may be similar to the type, therefore the
method can just call getAllOfTypeFromModel(kind)
42
Implementing IModel: Exercises
1. Modify the method getAllOfTypeFromModel()
2. Modify the method createInstance()
3. Modify the method deleteElementInModel()
43
Implementing IModel : getElementById()
• returns a model element by its id
Examples:
➢ CSV – the IDs can be represented with a specific column
➢ XML – the IDs can be represented as an attribute
44
Implementing IModel : getElementId(), setElementId()
• gets/sets the id of a model element
45
Implementing IModel : getEnumerationValue()
• used to retrieve an enumeration literal from a specific enumeration
46
Implementation of the EMC driver
Three classes are required:
• a class for defining the model
❑ implements IModel
• a Property Getter class for the model
❑ implements IPropertyGetter
• a Property Setter class for the model
❑ implements IPropertySetter
47
Property Getter class
➢ retrieve the value of a property
➢ extend/implement one of the following:
• IPropertyGetter
• AbstractPropertyGetter
• JavaPropertyGetter
…
48
Property Getter class
Examples:
• CSV driver
• Plain XML driver
• YAML driver
49
Implementing the Property Getter class
50
Property Setter class
➢ set the value of a property
➢ extend/implement one of the following:
• IPropertySetter
• AbstractPropertySetter
• JavaPropertySetter
…
51
Property Setter class
Examples:
• CSV driver
• Plain XML driver
• YAML driver
52
Implementing the Property Setter class
53
Property Getter/Setter class: Exercises
1. Add a new property in the Property Getter class
2. Add a new property in the Property Setter class
54
Summary
➢implementation of the driver’s Eclipse-based development tools
➢implementation of the EMC driver
• a class for defining the model
• a Property Getter class for the model
• a Property Setter class for the model
55

More Related Content

Similar to Developing a new EMC Driver for Eclipse Epsilon

ITU - MDD - EMF
ITU - MDD - EMFITU - MDD - EMF
ITU - MDD - EMF
Tonny Madsen
 
BlaBlaConf'22 The art of MLOps in TensorFlow Ecosystem
BlaBlaConf'22 The art of MLOps in TensorFlow EcosystemBlaBlaConf'22 The art of MLOps in TensorFlow Ecosystem
BlaBlaConf'22 The art of MLOps in TensorFlow Ecosystem
Taha Bouhsine
 
Eclipse World 2007: Fundamentals of the Eclipse Modeling Framework
Eclipse World 2007: Fundamentals of the Eclipse Modeling FrameworkEclipse World 2007: Fundamentals of the Eclipse Modeling Framework
Eclipse World 2007: Fundamentals of the Eclipse Modeling Framework
Dave Steinberg
 
Flink Forward Berlin 2017: Boris Lublinsky, Stavros Kontopoulos - Introducing...
Flink Forward Berlin 2017: Boris Lublinsky, Stavros Kontopoulos - Introducing...Flink Forward Berlin 2017: Boris Lublinsky, Stavros Kontopoulos - Introducing...
Flink Forward Berlin 2017: Boris Lublinsky, Stavros Kontopoulos - Introducing...
Flink Forward
 
EclipseCon 2006: Introduction to the Eclipse Modeling Framework
EclipseCon 2006: Introduction to the Eclipse Modeling FrameworkEclipseCon 2006: Introduction to the Eclipse Modeling Framework
EclipseCon 2006: Introduction to the Eclipse Modeling Framework
Dave Steinberg
 
Thesis Defense (Gwendal DANIEL) - Nov 2017
Thesis Defense (Gwendal DANIEL) - Nov 2017Thesis Defense (Gwendal DANIEL) - Nov 2017
Thesis Defense (Gwendal DANIEL) - Nov 2017
Gwendal Daniel
 
Angular
AngularAngular
Angular
Lilia Sfaxi
 
classes object fgfhdfgfdgfgfgfgfdoop.pptx
classes object  fgfhdfgfdgfgfgfgfdoop.pptxclasses object  fgfhdfgfdgfgfgfgfdoop.pptx
classes object fgfhdfgfdgfgfgfgfdoop.pptx
arjun431527
 
TEMPLATES in C++ are one of important topics in Object Oriented Programming
TEMPLATES in C++ are one of important topics in Object Oriented ProgrammingTEMPLATES in C++ are one of important topics in Object Oriented Programming
TEMPLATES in C++ are one of important topics in Object Oriented Programming
208BVijaySunder
 
AToMPM - Introductory Tutorial
AToMPM - Introductory TutorialAToMPM - Introductory Tutorial
AToMPM - Introductory Tutorial
Eugene Syriani
 
CoreML
CoreMLCoreML
CoreML
Ali Akhtar
 
Query Views Transformations (QVT)
Query Views Transformations (QVT)Query Views Transformations (QVT)
Query Views Transformations (QVT)
Hussein Alshkhir
 
5
55
CSharp Presentation
CSharp PresentationCSharp Presentation
CSharp Presentation
Vishwa Mohan
 
Java 102 intro to object-oriented programming in java
Java 102   intro to object-oriented programming in javaJava 102   intro to object-oriented programming in java
Java 102 intro to object-oriented programming in java
agorolabs
 
templates.ppt
templates.ppttemplates.ppt
templates.ppt
Saiganesh124618
 
Wodel: A Domain-Specific Language for Model Mutation
Wodel: A Domain-Specific Language for Model MutationWodel: A Domain-Specific Language for Model Mutation
Wodel: A Domain-Specific Language for Model Mutation
Pablo Gómez Abajo
 
Automatically bridging UML profiles into MOF metamodels
Automatically bridging UML profiles into MOF metamodelsAutomatically bridging UML profiles into MOF metamodels
Automatically bridging UML profiles into MOF metamodels
Ivano Malavolta
 
EclipseCon 2005: Everything You Always Wanted to do with EMF (But were Afraid...
EclipseCon 2005: Everything You Always Wanted to do with EMF (But were Afraid...EclipseCon 2005: Everything You Always Wanted to do with EMF (But were Afraid...
EclipseCon 2005: Everything You Always Wanted to do with EMF (But were Afraid...
Dave Steinberg
 
P Training Presentation
P Training PresentationP Training Presentation
P Training Presentation
Gaurav Tyagi
 

Similar to Developing a new EMC Driver for Eclipse Epsilon (20)

ITU - MDD - EMF
ITU - MDD - EMFITU - MDD - EMF
ITU - MDD - EMF
 
BlaBlaConf'22 The art of MLOps in TensorFlow Ecosystem
BlaBlaConf'22 The art of MLOps in TensorFlow EcosystemBlaBlaConf'22 The art of MLOps in TensorFlow Ecosystem
BlaBlaConf'22 The art of MLOps in TensorFlow Ecosystem
 
Eclipse World 2007: Fundamentals of the Eclipse Modeling Framework
Eclipse World 2007: Fundamentals of the Eclipse Modeling FrameworkEclipse World 2007: Fundamentals of the Eclipse Modeling Framework
Eclipse World 2007: Fundamentals of the Eclipse Modeling Framework
 
Flink Forward Berlin 2017: Boris Lublinsky, Stavros Kontopoulos - Introducing...
Flink Forward Berlin 2017: Boris Lublinsky, Stavros Kontopoulos - Introducing...Flink Forward Berlin 2017: Boris Lublinsky, Stavros Kontopoulos - Introducing...
Flink Forward Berlin 2017: Boris Lublinsky, Stavros Kontopoulos - Introducing...
 
EclipseCon 2006: Introduction to the Eclipse Modeling Framework
EclipseCon 2006: Introduction to the Eclipse Modeling FrameworkEclipseCon 2006: Introduction to the Eclipse Modeling Framework
EclipseCon 2006: Introduction to the Eclipse Modeling Framework
 
Thesis Defense (Gwendal DANIEL) - Nov 2017
Thesis Defense (Gwendal DANIEL) - Nov 2017Thesis Defense (Gwendal DANIEL) - Nov 2017
Thesis Defense (Gwendal DANIEL) - Nov 2017
 
Angular
AngularAngular
Angular
 
classes object fgfhdfgfdgfgfgfgfdoop.pptx
classes object  fgfhdfgfdgfgfgfgfdoop.pptxclasses object  fgfhdfgfdgfgfgfgfdoop.pptx
classes object fgfhdfgfdgfgfgfgfdoop.pptx
 
TEMPLATES in C++ are one of important topics in Object Oriented Programming
TEMPLATES in C++ are one of important topics in Object Oriented ProgrammingTEMPLATES in C++ are one of important topics in Object Oriented Programming
TEMPLATES in C++ are one of important topics in Object Oriented Programming
 
AToMPM - Introductory Tutorial
AToMPM - Introductory TutorialAToMPM - Introductory Tutorial
AToMPM - Introductory Tutorial
 
CoreML
CoreMLCoreML
CoreML
 
Query Views Transformations (QVT)
Query Views Transformations (QVT)Query Views Transformations (QVT)
Query Views Transformations (QVT)
 
5
55
5
 
CSharp Presentation
CSharp PresentationCSharp Presentation
CSharp Presentation
 
Java 102 intro to object-oriented programming in java
Java 102   intro to object-oriented programming in javaJava 102   intro to object-oriented programming in java
Java 102 intro to object-oriented programming in java
 
templates.ppt
templates.ppttemplates.ppt
templates.ppt
 
Wodel: A Domain-Specific Language for Model Mutation
Wodel: A Domain-Specific Language for Model MutationWodel: A Domain-Specific Language for Model Mutation
Wodel: A Domain-Specific Language for Model Mutation
 
Automatically bridging UML profiles into MOF metamodels
Automatically bridging UML profiles into MOF metamodelsAutomatically bridging UML profiles into MOF metamodels
Automatically bridging UML profiles into MOF metamodels
 
EclipseCon 2005: Everything You Always Wanted to do with EMF (But were Afraid...
EclipseCon 2005: Everything You Always Wanted to do with EMF (But were Afraid...EclipseCon 2005: Everything You Always Wanted to do with EMF (But were Afraid...
EclipseCon 2005: Everything You Always Wanted to do with EMF (But were Afraid...
 
P Training Presentation
P Training PresentationP Training Presentation
P Training Presentation
 

Recently uploaded

Introduction to Computer Networks & OSI MODEL.ppt
Introduction to Computer Networks & OSI MODEL.pptIntroduction to Computer Networks & OSI MODEL.ppt
Introduction to Computer Networks & OSI MODEL.ppt
Dwarkadas J Sanghvi College of Engineering
 
UNIT 4 LINEAR INTEGRATED CIRCUITS-DIGITAL ICS
UNIT 4 LINEAR INTEGRATED CIRCUITS-DIGITAL ICSUNIT 4 LINEAR INTEGRATED CIRCUITS-DIGITAL ICS
UNIT 4 LINEAR INTEGRATED CIRCUITS-DIGITAL ICS
vmspraneeth
 
FULL STACK PROGRAMMING - Both Front End and Back End
FULL STACK PROGRAMMING - Both Front End and Back EndFULL STACK PROGRAMMING - Both Front End and Back End
FULL STACK PROGRAMMING - Both Front End and Back End
PreethaV16
 
Call For Paper -3rd International Conference on Artificial Intelligence Advan...
Call For Paper -3rd International Conference on Artificial Intelligence Advan...Call For Paper -3rd International Conference on Artificial Intelligence Advan...
Call For Paper -3rd International Conference on Artificial Intelligence Advan...
ijseajournal
 
一比一原版(uofo毕业证书)美国俄勒冈大学毕业证如何办理
一比一原版(uofo毕业证书)美国俄勒冈大学毕业证如何办理一比一原版(uofo毕业证书)美国俄勒冈大学毕业证如何办理
一比一原版(uofo毕业证书)美国俄勒冈大学毕业证如何办理
upoux
 
comptia-security-sy0-701-exam-objectives-(5-0).pdf
comptia-security-sy0-701-exam-objectives-(5-0).pdfcomptia-security-sy0-701-exam-objectives-(5-0).pdf
comptia-security-sy0-701-exam-objectives-(5-0).pdf
foxlyon
 
Open Channel Flow: fluid flow with a free surface
Open Channel Flow: fluid flow with a free surfaceOpen Channel Flow: fluid flow with a free surface
Open Channel Flow: fluid flow with a free surface
Indrajeet sahu
 
Tools & Techniques for Commissioning and Maintaining PV Systems W-Animations ...
Tools & Techniques for Commissioning and Maintaining PV Systems W-Animations ...Tools & Techniques for Commissioning and Maintaining PV Systems W-Animations ...
Tools & Techniques for Commissioning and Maintaining PV Systems W-Animations ...
Transcat
 
Ericsson LTE Throughput Troubleshooting Techniques.ppt
Ericsson LTE Throughput Troubleshooting Techniques.pptEricsson LTE Throughput Troubleshooting Techniques.ppt
Ericsson LTE Throughput Troubleshooting Techniques.ppt
wafawafa52
 
SELENIUM CONF -PALLAVI SHARMA - 2024.pdf
SELENIUM CONF -PALLAVI SHARMA - 2024.pdfSELENIUM CONF -PALLAVI SHARMA - 2024.pdf
SELENIUM CONF -PALLAVI SHARMA - 2024.pdf
Pallavi Sharma
 
Sri Guru Hargobind Ji - Bandi Chor Guru.pdf
Sri Guru Hargobind Ji - Bandi Chor Guru.pdfSri Guru Hargobind Ji - Bandi Chor Guru.pdf
Sri Guru Hargobind Ji - Bandi Chor Guru.pdf
Balvir Singh
 
Accident detection system project report.pdf
Accident detection system project report.pdfAccident detection system project report.pdf
Accident detection system project report.pdf
Kamal Acharya
 
FUNDAMENTALS OF MECHANICAL ENGINEERING.pdf
FUNDAMENTALS OF MECHANICAL ENGINEERING.pdfFUNDAMENTALS OF MECHANICAL ENGINEERING.pdf
FUNDAMENTALS OF MECHANICAL ENGINEERING.pdf
EMERSON EDUARDO RODRIGUES
 
Properties of Fluids, Fluid Statics, Pressure Measurement
Properties of Fluids, Fluid Statics, Pressure MeasurementProperties of Fluids, Fluid Statics, Pressure Measurement
Properties of Fluids, Fluid Statics, Pressure Measurement
Indrajeet sahu
 
ELS: 2.4.1 POWER ELECTRONICS Course objectives: This course will enable stude...
ELS: 2.4.1 POWER ELECTRONICS Course objectives: This course will enable stude...ELS: 2.4.1 POWER ELECTRONICS Course objectives: This course will enable stude...
ELS: 2.4.1 POWER ELECTRONICS Course objectives: This course will enable stude...
Kuvempu University
 
SENTIMENT ANALYSIS ON PPT AND Project template_.pptx
SENTIMENT ANALYSIS ON PPT AND Project template_.pptxSENTIMENT ANALYSIS ON PPT AND Project template_.pptx
SENTIMENT ANALYSIS ON PPT AND Project template_.pptx
b0754201
 
Determination of Equivalent Circuit parameters and performance characteristic...
Determination of Equivalent Circuit parameters and performance characteristic...Determination of Equivalent Circuit parameters and performance characteristic...
Determination of Equivalent Circuit parameters and performance characteristic...
pvpriya2
 
Supermarket Management System Project Report.pdf
Supermarket Management System Project Report.pdfSupermarket Management System Project Report.pdf
Supermarket Management System Project Report.pdf
Kamal Acharya
 
Digital Twins Computer Networking Paper Presentation.pptx
Digital Twins Computer Networking Paper Presentation.pptxDigital Twins Computer Networking Paper Presentation.pptx
Digital Twins Computer Networking Paper Presentation.pptx
aryanpankaj78
 
This study Examines the Effectiveness of Talent Procurement through the Imple...
This study Examines the Effectiveness of Talent Procurement through the Imple...This study Examines the Effectiveness of Talent Procurement through the Imple...
This study Examines the Effectiveness of Talent Procurement through the Imple...
DharmaBanothu
 

Recently uploaded (20)

Introduction to Computer Networks & OSI MODEL.ppt
Introduction to Computer Networks & OSI MODEL.pptIntroduction to Computer Networks & OSI MODEL.ppt
Introduction to Computer Networks & OSI MODEL.ppt
 
UNIT 4 LINEAR INTEGRATED CIRCUITS-DIGITAL ICS
UNIT 4 LINEAR INTEGRATED CIRCUITS-DIGITAL ICSUNIT 4 LINEAR INTEGRATED CIRCUITS-DIGITAL ICS
UNIT 4 LINEAR INTEGRATED CIRCUITS-DIGITAL ICS
 
FULL STACK PROGRAMMING - Both Front End and Back End
FULL STACK PROGRAMMING - Both Front End and Back EndFULL STACK PROGRAMMING - Both Front End and Back End
FULL STACK PROGRAMMING - Both Front End and Back End
 
Call For Paper -3rd International Conference on Artificial Intelligence Advan...
Call For Paper -3rd International Conference on Artificial Intelligence Advan...Call For Paper -3rd International Conference on Artificial Intelligence Advan...
Call For Paper -3rd International Conference on Artificial Intelligence Advan...
 
一比一原版(uofo毕业证书)美国俄勒冈大学毕业证如何办理
一比一原版(uofo毕业证书)美国俄勒冈大学毕业证如何办理一比一原版(uofo毕业证书)美国俄勒冈大学毕业证如何办理
一比一原版(uofo毕业证书)美国俄勒冈大学毕业证如何办理
 
comptia-security-sy0-701-exam-objectives-(5-0).pdf
comptia-security-sy0-701-exam-objectives-(5-0).pdfcomptia-security-sy0-701-exam-objectives-(5-0).pdf
comptia-security-sy0-701-exam-objectives-(5-0).pdf
 
Open Channel Flow: fluid flow with a free surface
Open Channel Flow: fluid flow with a free surfaceOpen Channel Flow: fluid flow with a free surface
Open Channel Flow: fluid flow with a free surface
 
Tools & Techniques for Commissioning and Maintaining PV Systems W-Animations ...
Tools & Techniques for Commissioning and Maintaining PV Systems W-Animations ...Tools & Techniques for Commissioning and Maintaining PV Systems W-Animations ...
Tools & Techniques for Commissioning and Maintaining PV Systems W-Animations ...
 
Ericsson LTE Throughput Troubleshooting Techniques.ppt
Ericsson LTE Throughput Troubleshooting Techniques.pptEricsson LTE Throughput Troubleshooting Techniques.ppt
Ericsson LTE Throughput Troubleshooting Techniques.ppt
 
SELENIUM CONF -PALLAVI SHARMA - 2024.pdf
SELENIUM CONF -PALLAVI SHARMA - 2024.pdfSELENIUM CONF -PALLAVI SHARMA - 2024.pdf
SELENIUM CONF -PALLAVI SHARMA - 2024.pdf
 
Sri Guru Hargobind Ji - Bandi Chor Guru.pdf
Sri Guru Hargobind Ji - Bandi Chor Guru.pdfSri Guru Hargobind Ji - Bandi Chor Guru.pdf
Sri Guru Hargobind Ji - Bandi Chor Guru.pdf
 
Accident detection system project report.pdf
Accident detection system project report.pdfAccident detection system project report.pdf
Accident detection system project report.pdf
 
FUNDAMENTALS OF MECHANICAL ENGINEERING.pdf
FUNDAMENTALS OF MECHANICAL ENGINEERING.pdfFUNDAMENTALS OF MECHANICAL ENGINEERING.pdf
FUNDAMENTALS OF MECHANICAL ENGINEERING.pdf
 
Properties of Fluids, Fluid Statics, Pressure Measurement
Properties of Fluids, Fluid Statics, Pressure MeasurementProperties of Fluids, Fluid Statics, Pressure Measurement
Properties of Fluids, Fluid Statics, Pressure Measurement
 
ELS: 2.4.1 POWER ELECTRONICS Course objectives: This course will enable stude...
ELS: 2.4.1 POWER ELECTRONICS Course objectives: This course will enable stude...ELS: 2.4.1 POWER ELECTRONICS Course objectives: This course will enable stude...
ELS: 2.4.1 POWER ELECTRONICS Course objectives: This course will enable stude...
 
SENTIMENT ANALYSIS ON PPT AND Project template_.pptx
SENTIMENT ANALYSIS ON PPT AND Project template_.pptxSENTIMENT ANALYSIS ON PPT AND Project template_.pptx
SENTIMENT ANALYSIS ON PPT AND Project template_.pptx
 
Determination of Equivalent Circuit parameters and performance characteristic...
Determination of Equivalent Circuit parameters and performance characteristic...Determination of Equivalent Circuit parameters and performance characteristic...
Determination of Equivalent Circuit parameters and performance characteristic...
 
Supermarket Management System Project Report.pdf
Supermarket Management System Project Report.pdfSupermarket Management System Project Report.pdf
Supermarket Management System Project Report.pdf
 
Digital Twins Computer Networking Paper Presentation.pptx
Digital Twins Computer Networking Paper Presentation.pptxDigital Twins Computer Networking Paper Presentation.pptx
Digital Twins Computer Networking Paper Presentation.pptx
 
This study Examines the Effectiveness of Talent Procurement through the Imple...
This study Examines the Effectiveness of Talent Procurement through the Imple...This study Examines the Effectiveness of Talent Procurement through the Imple...
This study Examines the Effectiveness of Talent Procurement through the Imple...
 

Developing a new EMC Driver for Eclipse Epsilon

  • 1. Developing a new EMC Driver for Eclipse Epsilon Ionut Predoaia
  • 3. EMC Drivers • the Epsilon Model Connectivity (EMC) layer provides abstraction facilities over concrete modelling technologies (EMF, XML, Simulink) • enables Epsilon programs to interact with models conforming to these technologies in a uniform manner • EMC makes minimal assumptions about the structure and the organization of the underlying modelling technologies • it intentionally refrains from defining classes for concepts such as model element, type and metamodel • more resistant to future changes in the implementations of the current technologies and can also embrace new technologies without changes 3
  • 4. Implementation of EMC drivers Two Eclipse plugins: ➢Implementation of the driver’s Eclipse-based development tools org.eclipse.epsilon.emc.XX.dt ➢Implementation of the EMC driver org.eclipse.epsilon.emc.XX where XX stands for the metamodeling technology used (e.g., EMF, XML, CSV) 4
  • 5. Eclipse-based development tools • provide a dialog to configure models conforming to the new metamodeling technology 5
  • 6. Implementation of Configuration Dialog • standard implementation (100 lines of code) Examples: CSV driver, Plain XML driver • minimal SWT knowledge required • dialog class extends ❑AbstractCachedModelConfigurationDialog ❑AbstractModelConfigurationDialog 6
  • 7. Configuration Dialog class extends AbstractCachedModelConfigurationDialog 7
  • 8. Configuration Dialog class extends AbstractCachedModelConfigurationDialog 8
  • 12. Configuration Dialog class extends AbstractCachedModelConfigurationDialog 12
  • 13. Configuration Dialog class extends AbstractCachedModelConfigurationDialog 13
  • 15. Configuration Dialog: Exercises 1. Modify the model name 2. Add a new group in the dialog (text field and checkbox) 15
  • 16. Implementation of EMC drivers Two Eclipse plugins: ➢Implementation of the driver’s Eclipse-based development tools org.eclipse.epsilon.emc.XX.dt ➢Implementation of the EMC driver org.eclipse.epsilon.emc.XX where XX stands for the metamodeling technology used (e.g., EMF, XML, CSV) 16
  • 17. Implementation of the EMC driver Three classes are required: • a class for defining the model ❑ implements IModel • a Property Getter class for the model ❑ implements IPropertyGetter • a Property Setter class for the model ❑ implements IPropertySetter 17
  • 18. Implementation of the EMC driver 18
  • 19. Class for defining the model Extend/implement one of the following: • IModel • Model • CachedModel<ModelElementType> (recommended) … 19
  • 20. Class for defining the model (CachedModel) • identify what is a model element in your modelling language: ❑ XML : Element ⟶ CachedModel<Element> ❑ CSV : Map ⟶ CachedModel<Map<String, Object>> ❑ YAML : Entry ⟶ CachedModel<Entry> • the methods from IModel must be parameterised using the identified model element type 20
  • 21. Class for defining the model Examples: • CSV driver • Plain XML driver • YAML driver • Simulink driver 21
  • 22. Hook Model to Epsilon • we need to inform Epsilon that there is a new model type available: ❑ the name of the model type ❑ the class of the new model ❑ the configuration dialog of the new model ❑ an icon for the launch dialog • use the Extension Point: org.eclipse.epsilon.common.dt.modelType • added using MANIFEST.MF (Extension tab) 22
  • 23. Hook Model to Epsilon 23
  • 24. Implementing IModel : load() • loads the model in memory from storage • the properties from the Configuration Dialog are passed in the properties parameter of the load method • initializes the required data and parameters 24
  • 25. Implementing IModel : loadModel() • loads in memory the selected model in the Configuration Dialog • ideally, it should set up a data structure that keeps track of instantiated model elements 25
  • 26. Implementing IModel : disposeModel() • executes clean-up code for releasing model resources 26
  • 27. Implementing IModel : store() • persists the in-memory representation of the model to a storage location • the method is executed only when the value of the property Store on disposal is true 27
  • 28. Implementing IModel : isLoaded() • returns true if the model is loaded in memory 28
  • 29. Implementing IModel : isModelElement() • returns true if an instance is a model element • this is usually done by comparing the type of the instance with the type of the model element 29
  • 30. Types and Kinds • the type-of relationship appears when a model element is an instance of a type • the kind-of relationship appears when the model element is an instance of a type or any of its sub-types Examples: ➢ s_{nodeName} for scalar nodes ➢ m_{nodeName} for mapping nodes ➢ l_{nodeName} for list nodes 30
  • 31. Implementing IModel : getTypeOf() • returns the fully-qualified name of the type of a model element (instance) • the type represents the class of the model element • CachedModel<ModelElementType> 31
  • 32. Implementing IModel : getTypeNameOf() • returns the type name of a model element (instance) • the type name is used for caching purposes 32
  • 33. Implementing IModel : getAllTypeNamesOf() • returns an immutable set over the type name of a single model element instance 33
  • 34. Implementing IModel : getCacheKeyForType() • the returned string is the type • used as a key for caching model elements by type 34
  • 35. Implementing IModel : hasType() • returns true if the model supports a type with the specified name (e.g., s_role, m_city, t_book) 35
  • 36. Implementing IModel : isInstantiable() • returns true if instances of the type can be created • it is usually based on the method hasType() 36
  • 37. Implementing IModel : creating instances • create a new model element instance of a specific type and return it • add the created instance to the list of created instances 37
  • 38. Implementing IModel : deleting instances • delete the model element instance from the in-memory representation of the model • delete the model element instance from the list of created instances 38
  • 39. Implementing IModel : owns() • returns true if the model element instance is contained within the in- memory representation of the model or in the list of created instances 39
  • 40. Implementing IModel : allContentsFromModel() • returns the entire content of the model, i.e., all model elements 40
  • 41. Implementing IModel : getAllOfTypeFromModel() • returns all model elements with the specified type 41
  • 42. Implementing IModel : getAllOfKindFromModel() • returns all model elements with the specified kind • in many cases the kind may be similar to the type, therefore the method can just call getAllOfTypeFromModel(kind) 42
  • 43. Implementing IModel: Exercises 1. Modify the method getAllOfTypeFromModel() 2. Modify the method createInstance() 3. Modify the method deleteElementInModel() 43
  • 44. Implementing IModel : getElementById() • returns a model element by its id Examples: ➢ CSV – the IDs can be represented with a specific column ➢ XML – the IDs can be represented as an attribute 44
  • 45. Implementing IModel : getElementId(), setElementId() • gets/sets the id of a model element 45
  • 46. Implementing IModel : getEnumerationValue() • used to retrieve an enumeration literal from a specific enumeration 46
  • 47. Implementation of the EMC driver Three classes are required: • a class for defining the model ❑ implements IModel • a Property Getter class for the model ❑ implements IPropertyGetter • a Property Setter class for the model ❑ implements IPropertySetter 47
  • 48. Property Getter class ➢ retrieve the value of a property ➢ extend/implement one of the following: • IPropertyGetter • AbstractPropertyGetter • JavaPropertyGetter … 48
  • 49. Property Getter class Examples: • CSV driver • Plain XML driver • YAML driver 49
  • 50. Implementing the Property Getter class 50
  • 51. Property Setter class ➢ set the value of a property ➢ extend/implement one of the following: • IPropertySetter • AbstractPropertySetter • JavaPropertySetter … 51
  • 52. Property Setter class Examples: • CSV driver • Plain XML driver • YAML driver 52
  • 53. Implementing the Property Setter class 53
  • 54. Property Getter/Setter class: Exercises 1. Add a new property in the Property Getter class 2. Add a new property in the Property Setter class 54
  • 55. Summary ➢implementation of the driver’s Eclipse-based development tools ➢implementation of the EMC driver • a class for defining the model • a Property Getter class for the model • a Property Setter class for the model 55