SlideShare a Scribd company logo
1 of 27
Download to read offline
Merging Models with the
Epsilon Merging Language
– A Decade Later
Dimitris Kolovos, Richard Paige, and Fiona Polack
Department of Computer Science
University of York
firstname.lastname@york.ac.uk
D. Kolovos et. al. – ACM/IEEE MoDELS 2016 October 6, 2016 – Slide 1/23
Ambition (in 2004)
Develop a hybrid textual language for model merging
In the same way that ATL targeted M2M, OCL targeted model
validation etc.
Desirable features
Expressiveness
Metamodel and modelling-technology independence
Support for merging heterogeneous models
D. Kolovos et. al. – ACM/IEEE MoDELS 2016 October 6, 2016 – Slide 2/23
First Steps (2004–2005)
Started with a version of the OCL grammar (ANTLR) and
extended it with merging-specific syntax
Wrote an interpreter for the AST
Introduced an abstraction layer for modelling technologies
Implemented the abstraction layer for the NetBeans MetaData
Repository (MDR) – MOF 1.4
Implemented the first version of EML’s Eclipse-based
development tools
D. Kolovos et. al. – ACM/IEEE MoDELS 2016 October 6, 2016 – Slide 3/23
Heterogeneous Model Merging?
D. Kolovos et. al. – ACM/IEEE MoDELS 2016 October 6, 2016 – Slide 5/23
Heterogeneous Model Merging?
D. Kolovos et. al. – ACM/IEEE MoDELS 2016 October 6, 2016 – Slide 6/23
Heterogeneous Model Merging?
D. Kolovos et. al. – ACM/IEEE MoDELS 2016 October 6, 2016 – Slide 6/23
Merging Process
Focused on 2-way merging
Steps
1 Establish correspondences between elements in the two models
2 Merge matching elements (optional)
3 Transform non-matching elements (optional)
D. Kolovos et. al. – ACM/IEEE MoDELS 2016 October 6, 2016 – Slide 7/23
Matching Elements
Notes
We establish correspondences based on national insurance
number matching
List!Person means: type “Person” from model “List”
Inspired by ATL
rule MatchPersonWithTaxPayer
match p : List!Person
with tp : HMRC!TaxPayer {
compare: (p.country = "UK") and (p.taxId = tp.nin)
}
D. Kolovos et. al. – ACM/IEEE MoDELS 2016 October 6, 2016 – Slide 8/23
Merging Elements
Notes
We merge matched Persons with their corresponding
TaxPayers and produce (notification) Letters as output
We don’t want to bother those whose incomes match
rule DiscrepancyLetter
merge p : List!Person
with tp : HMRC!TaxPayer
into l : Outbox!Letter {
guard: tp.declaredIncome <> p.income
l.address = tp.address;
l.text = "Dear " + p.name + ", ";
if (p.income > tp.declaredIncome) {
l.text += "you are doomed.";
}
else { l.text += "we love you."; }
}
D. Kolovos et. al. – ACM/IEEE MoDELS 2016 October 6, 2016 – Slide 9/23
Transforming Unmatched Elements
Notes
Unmatched Person elements from the UK means non-existing
national insurance numbers (i.e. fraud!)
rule FraudLetter
transform p : List!Person
into l : Outbox!Letter {
guard: p.country == "UK"
l.address = p.address;
l.text = "You are doomed beyond imagination.";
}
D. Kolovos et. al. – ACM/IEEE MoDELS 2016 October 6, 2016 – Slide 10/23
Modularisation
An EML program consists of
Matching rules
Merging rules
Transformation rules
These are three different languages!
. . . which share a common OCL-based imperative expression
language, model connectivity facilities etc.
D. Kolovos et. al. – ACM/IEEE MoDELS 2016 October 6, 2016 – Slide 11/23
Modularisation
An EML program consists of
Matching rules
Merging rules
Transformation rules
These are three four different languages!
. . . which share model connectivity facilities etc.
D. Kolovos et. al. – ACM/IEEE MoDELS 2016 October 6, 2016 – Slide 11/23
Modularisation (2006)
D. Kolovos et. al. – ACM/IEEE MoDELS 2016 October 6, 2016 – Slide 12/23
Modularisation (2006)
D. Kolovos et. al. – ACM/IEEE MoDELS 2016 October 6, 2016 – Slide 12/23
Eclipse Modeling Project
Epsilon joined the Eclipse Modeling GMT incubator in 2006
Graduated (v1.0) in 2012
Currently in v1.3 (v1.4 approved yesterday)
Substantial boost to adoption
≈ 8,000 forum posts since 2008
In open-source projects and in industry
To teach modelling and MDE courses
http://eclipse.org/epsilon/users
D. Kolovos et. al. – ACM/IEEE MoDELS 2016 October 6, 2016 – Slide 13/23
Epsilon Validation Language (EVL)
Key capabilities
Human-readable messages
Constraint dependencies
Quick fixes
context List!Person {
constraint ValidNin {
guard : self.country = "UK"
check : HMRC!TaxPayer.all.
exists(tp|self.taxId = tp.nin)
message : "Unknown National Insurance Number: " +
self.taxId
}
}
D. Kolovos et. al. – ACM/IEEE MoDELS 2016 October 6, 2016 – Slide 15/23
Epsilon Validation Language (EVL)
context List!Person {
constraint MatchingIncome {
// Won’t be evaluated if ValidNin is not satisfied
guard : self.satisfies("ValidNin")
check {
var taxPayer = HMRC!TaxPayer.all.
selectOne(tp|self.taxId = tp.nin);
return taxPayer.declaredIncome = self.income;
}
message : "Mismatching income: " + self.income
+ "<>" + taxPayer.declaredIncome
}
}
D. Kolovos et. al. – ACM/IEEE MoDELS 2016 October 6, 2016 – Slide 16/23
Epsilon Generation Language (EGL)
Key capabilities
Template-based M2T language
Separate sub-language for rule-based template coordination
Support for hand-written code in generated files
rule EClass2DBClass
transform c : EClass {
guard : c.isAnnotatedAs("db")
template : "eclass2dbclass.egl"
target : c.name + ".java"
}
D. Kolovos et. al. – ACM/IEEE MoDELS 2016 October 6, 2016 – Slide 17/23
Epsilon Generation Language (EGL)
[%for (f in c.eStructuralFeatures.select(f|f.isMany)) { %]
protected List<[%=f.eType.getJavaBoxedName()%]>
[%=sf.name%] = null;
[%}%]
[%for (r in c.eReferences.select(r|not r.isMany)) { %]
protected [%=r.eType.getJavaName()%] [%=r.name%] = null;
[%}%]
[%if (c.isAnnotatedAs("customize")){%]
[% out.setContentType("Java"); %]
// protected region custom-fields-and-methods on begin
// protected region custom-fields-and-methods end
[%}%]
D. Kolovos et. al. – ACM/IEEE MoDELS 2016 October 6, 2016 – Slide 18/23
Epsilon Pattern Language (EPL)
Key capabilities
Textual language for model pattern matching
In-place transformation capabilities
Matches exposed as a “virtual” model
patterns → types, matches → elements, roles → properties
pattern PublicField
class : ClassDeclaration,
field : FieldDeclaration from: class.bodyDeclarations,
setter : MethodDeclaration from: class.bodyDeclarations
guard: setter.name = "set" + field.getName(),
getter : MethodDeclaration from: class.bodyDeclarations
guard : (getter.name = "get" + field.getName()
or getter.name = "is" + field.getName()) { }
D. Kolovos et. al. – ACM/IEEE MoDELS 2016 October 6, 2016 – Slide 19/23
Epsilon Pattern Language (EPL)
context Patterns!PublicField {
constraint GetterAndFieldSameType {
check : self.getter.returnType.type =
self.field.type.type
message : "The getter of " + self.class.name +
"." + self.field.fragments.at(0).name +
" does not have the same type as" +
" the field itself"
}
}
D. Kolovos et. al. – ACM/IEEE MoDELS 2016 October 6, 2016 – Slide 20/23
Epsilon (2004 - 2016)
D. Kolovos et. al. – ACM/IEEE MoDELS 2016 October 6, 2016 – Slide 21/23
Epsilon (2004 - 2016)
D. Kolovos et. al. – ACM/IEEE MoDELS 2016 October 6, 2016 – Slide 21/23
Epsilon (2004 - 2016)
D. Kolovos et. al. – ACM/IEEE MoDELS 2016 October 6, 2016 – Slide 21/23
Reflection
EML was the first language tailored for model merging
The 2006 MoDELS paper made the case for non-trivial
merging of heterogeneous models
EML was the seed from which Epsilon eventually grew
EML is too verbose for merging homogeneous models
. . . although homogeneous merging strategies can be trivially
generated using HOTs
EML turned out to be one of the least popular languages in
Epsilon
Little practical need for complex model merging?
D. Kolovos et. al. – ACM/IEEE MoDELS 2016 October 6, 2016 – Slide 22/23
Looking Ahead
Incrementality
Prototype for EGL → Robust implementation across Epsilon
User experience
Code completion, refactoring etc.
Integration
Enterprise Architect, MagicDraw etc.
Optimisation
e.g. technology-specific implementations of select() to avoid
naive iteration and use indexes instead
D. Kolovos et. al. – ACM/IEEE MoDELS 2016 October 6, 2016 – Slide 23/23

More Related Content

What's hot

What's hot (8)

2011dbms
2011dbms2011dbms
2011dbms
 
Intake 37 ef2
Intake 37 ef2Intake 37 ef2
Intake 37 ef2
 
Java Tutorial Lab 4
Java Tutorial Lab 4Java Tutorial Lab 4
Java Tutorial Lab 4
 
Dev Concepts: Object-Oriented Programming
Dev Concepts: Object-Oriented ProgrammingDev Concepts: Object-Oriented Programming
Dev Concepts: Object-Oriented Programming
 
Principles of object oriented programming
Principles of object oriented programmingPrinciples of object oriented programming
Principles of object oriented programming
 
Closing the Gap: Data Models for Documentary Linguistics
Closing the Gap: Data Models for Documentary LinguisticsClosing the Gap: Data Models for Documentary Linguistics
Closing the Gap: Data Models for Documentary Linguistics
 
Classroom Object Oriented Language (COOL)
Classroom Object Oriented Language (COOL)Classroom Object Oriented Language (COOL)
Classroom Object Oriented Language (COOL)
 
Java Tutorial Lab 6
Java Tutorial Lab 6Java Tutorial Lab 6
Java Tutorial Lab 6
 

Similar to Merging Models with the Epsilon Merging Language - A Decade Later

Bc0053 – vb.net & xml
Bc0053 – vb.net & xmlBc0053 – vb.net & xml
Bc0053 – vb.net & xml
smumbahelp
 
Multiple Inheritance
Multiple InheritanceMultiple Inheritance
Multiple Inheritance
Michal Píše
 
Runtime Environment Of .Net Divya Rathore
Runtime Environment Of .Net Divya RathoreRuntime Environment Of .Net Divya Rathore
Runtime Environment Of .Net Divya Rathore
Esha Yadav
 
SECTION D2)Display the item number and total cost for each order l.docx
SECTION D2)Display the item number and total cost for each order l.docxSECTION D2)Display the item number and total cost for each order l.docx
SECTION D2)Display the item number and total cost for each order l.docx
kenjordan97598
 

Similar to Merging Models with the Epsilon Merging Language - A Decade Later (20)

ptu3-harvey-m-deitel-paul-j-deitel-tem-r-nieto-contributor-paul-j-deitel.pdf
ptu3-harvey-m-deitel-paul-j-deitel-tem-r-nieto-contributor-paul-j-deitel.pdfptu3-harvey-m-deitel-paul-j-deitel-tem-r-nieto-contributor-paul-j-deitel.pdf
ptu3-harvey-m-deitel-paul-j-deitel-tem-r-nieto-contributor-paul-j-deitel.pdf
 
Implementing the Genetic Algorithm in XSLT: PoC
Implementing the Genetic Algorithm in XSLT: PoCImplementing the Genetic Algorithm in XSLT: PoC
Implementing the Genetic Algorithm in XSLT: PoC
 
MEX Vocabulary - A Lightweight Interchange Format for Machine Learning Experi...
MEX Vocabulary - A Lightweight Interchange Format for Machine Learning Experi...MEX Vocabulary - A Lightweight Interchange Format for Machine Learning Experi...
MEX Vocabulary - A Lightweight Interchange Format for Machine Learning Experi...
 
Bc0053 – vb.net & xml
Bc0053 – vb.net & xmlBc0053 – vb.net & xml
Bc0053 – vb.net & xml
 
Bc0053 – vb.net & xml
Bc0053 – vb.net & xmlBc0053 – vb.net & xml
Bc0053 – vb.net & xml
 
I x scripting
I x scriptingI x scripting
I x scripting
 
A Project Based Lab Report On AMUZING JOKE
A Project Based Lab Report On AMUZING JOKEA Project Based Lab Report On AMUZING JOKE
A Project Based Lab Report On AMUZING JOKE
 
Retour sur la Microsoft //Build 2018
Retour sur la Microsoft //Build 2018Retour sur la Microsoft //Build 2018
Retour sur la Microsoft //Build 2018
 
On The Evolution of CAEX: A Language Engineering Perspective
On The Evolution of CAEX: A Language Engineering PerspectiveOn The Evolution of CAEX: A Language Engineering Perspective
On The Evolution of CAEX: A Language Engineering Perspective
 
Knowledge Graph Futures
Knowledge Graph FuturesKnowledge Graph Futures
Knowledge Graph Futures
 
Bt0082 visual basic
Bt0082 visual basicBt0082 visual basic
Bt0082 visual basic
 
Multiple Inheritance
Multiple InheritanceMultiple Inheritance
Multiple Inheritance
 
LinkML Intro July 2022.pptx PLEASE VIEW THIS ON ZENODO
LinkML Intro July 2022.pptx PLEASE VIEW THIS ON ZENODOLinkML Intro July 2022.pptx PLEASE VIEW THIS ON ZENODO
LinkML Intro July 2022.pptx PLEASE VIEW THIS ON ZENODO
 
Semantic Interoperability - grafi della conoscenza
Semantic Interoperability - grafi della conoscenzaSemantic Interoperability - grafi della conoscenza
Semantic Interoperability - grafi della conoscenza
 
Runtime Environment Of .Net Divya Rathore
Runtime Environment Of .Net Divya RathoreRuntime Environment Of .Net Divya Rathore
Runtime Environment Of .Net Divya Rathore
 
Bc0053 – vb.net & xml
Bc0053 – vb.net & xmlBc0053 – vb.net & xml
Bc0053 – vb.net & xml
 
notesnet.dk - Eclipse Modelling Tools
notesnet.dk - Eclipse Modelling Toolsnotesnet.dk - Eclipse Modelling Tools
notesnet.dk - Eclipse Modelling Tools
 
Implementing the Open Government Directive using the technologies of the Soci...
Implementing the Open Government Directive using the technologies of the Soci...Implementing the Open Government Directive using the technologies of the Soci...
Implementing the Open Government Directive using the technologies of the Soci...
 
CSharp Presentation
CSharp PresentationCSharp Presentation
CSharp Presentation
 
SECTION D2)Display the item number and total cost for each order l.docx
SECTION D2)Display the item number and total cost for each order l.docxSECTION D2)Display the item number and total cost for each order l.docx
SECTION D2)Display the item number and total cost for each order l.docx
 

More from Dimitris Kolovos

More from Dimitris Kolovos (12)

Picto: Model Visualisation via M2T Transformation
Picto: Model Visualisation via M2T TransformationPicto: Model Visualisation via M2T Transformation
Picto: Model Visualisation via M2T Transformation
 
The Epsilon Pattern Language
The Epsilon Pattern LanguageThe Epsilon Pattern Language
The Epsilon Pattern Language
 
Re-Implementing Apache Thrift using Model-Driven Engineering Technologies: An...
Re-Implementing Apache Thrift using Model-Driven Engineering Technologies: An...Re-Implementing Apache Thrift using Model-Driven Engineering Technologies: An...
Re-Implementing Apache Thrift using Model-Driven Engineering Technologies: An...
 
Partial Loading of XMI Models
Partial Loading of XMI ModelsPartial Loading of XMI Models
Partial Loading of XMI Models
 
Assessing the Use of Eclipse MDE Technologies in Open-Source Software Projects
Assessing the Use of Eclipse MDE Technologies in Open-Source Software ProjectsAssessing the Use of Eclipse MDE Technologies in Open-Source Software Projects
Assessing the Use of Eclipse MDE Technologies in Open-Source Software Projects
 
Code Generation as a Service
Code Generation as a ServiceCode Generation as a Service
Code Generation as a Service
 
Eclipse Modellng Forums: Looking at the Data
Eclipse Modellng Forums: Looking at the DataEclipse Modellng Forums: Looking at the Data
Eclipse Modellng Forums: Looking at the Data
 
Adding Spreadsheets to the MDE Toolbox
Adding Spreadsheets to the MDE ToolboxAdding Spreadsheets to the MDE Toolbox
Adding Spreadsheets to the MDE Toolbox
 
Programmatic Muddle Management
Programmatic Muddle ManagementProgrammatic Muddle Management
Programmatic Muddle Management
 
Epsilon
EpsilonEpsilon
Epsilon
 
COMPASS Early Safety Warning System (ESWS)
COMPASS Early Safety Warning System (ESWS)COMPASS Early Safety Warning System (ESWS)
COMPASS Early Safety Warning System (ESWS)
 
Eugenia
EugeniaEugenia
Eugenia
 

Recently uploaded

Biogenic Sulfur Gases as Biosignatures on Temperate Sub-Neptune Waterworlds
Biogenic Sulfur Gases as Biosignatures on Temperate Sub-Neptune WaterworldsBiogenic Sulfur Gases as Biosignatures on Temperate Sub-Neptune Waterworlds
Biogenic Sulfur Gases as Biosignatures on Temperate Sub-Neptune Waterworlds
Sérgio Sacani
 
Asymmetry in the atmosphere of the ultra-hot Jupiter WASP-76 b
Asymmetry in the atmosphere of the ultra-hot Jupiter WASP-76 bAsymmetry in the atmosphere of the ultra-hot Jupiter WASP-76 b
Asymmetry in the atmosphere of the ultra-hot Jupiter WASP-76 b
Sérgio Sacani
 
Formation of low mass protostars and their circumstellar disks
Formation of low mass protostars and their circumstellar disksFormation of low mass protostars and their circumstellar disks
Formation of low mass protostars and their circumstellar disks
Sérgio Sacani
 

Recently uploaded (20)

module for grade 9 for distance learning
module for grade 9 for distance learningmodule for grade 9 for distance learning
module for grade 9 for distance learning
 
Call Girls Alandi Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Alandi Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Alandi Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Alandi Call Me 7737669865 Budget Friendly No Advance Booking
 
Nanoparticles synthesis and characterization​ ​
Nanoparticles synthesis and characterization​  ​Nanoparticles synthesis and characterization​  ​
Nanoparticles synthesis and characterization​ ​
 
Biogenic Sulfur Gases as Biosignatures on Temperate Sub-Neptune Waterworlds
Biogenic Sulfur Gases as Biosignatures on Temperate Sub-Neptune WaterworldsBiogenic Sulfur Gases as Biosignatures on Temperate Sub-Neptune Waterworlds
Biogenic Sulfur Gases as Biosignatures on Temperate Sub-Neptune Waterworlds
 
GBSN - Microbiology (Unit 1)
GBSN - Microbiology (Unit 1)GBSN - Microbiology (Unit 1)
GBSN - Microbiology (Unit 1)
 
Pulmonary drug delivery system M.pharm -2nd sem P'ceutics
Pulmonary drug delivery system M.pharm -2nd sem P'ceuticsPulmonary drug delivery system M.pharm -2nd sem P'ceutics
Pulmonary drug delivery system M.pharm -2nd sem P'ceutics
 
Vip profile Call Girls In Lonavala 9748763073 For Genuine Sex Service At Just...
Vip profile Call Girls In Lonavala 9748763073 For Genuine Sex Service At Just...Vip profile Call Girls In Lonavala 9748763073 For Genuine Sex Service At Just...
Vip profile Call Girls In Lonavala 9748763073 For Genuine Sex Service At Just...
 
❤Jammu Kashmir Call Girls 8617697112 Personal Whatsapp Number 💦✅.
❤Jammu Kashmir Call Girls 8617697112 Personal Whatsapp Number 💦✅.❤Jammu Kashmir Call Girls 8617697112 Personal Whatsapp Number 💦✅.
❤Jammu Kashmir Call Girls 8617697112 Personal Whatsapp Number 💦✅.
 
FAIRSpectra - Enabling the FAIRification of Spectroscopy and Spectrometry
FAIRSpectra - Enabling the FAIRification of Spectroscopy and SpectrometryFAIRSpectra - Enabling the FAIRification of Spectroscopy and Spectrometry
FAIRSpectra - Enabling the FAIRification of Spectroscopy and Spectrometry
 
High Profile 🔝 8250077686 📞 Call Girls Service in GTB Nagar🍑
High Profile 🔝 8250077686 📞 Call Girls Service in GTB Nagar🍑High Profile 🔝 8250077686 📞 Call Girls Service in GTB Nagar🍑
High Profile 🔝 8250077686 📞 Call Girls Service in GTB Nagar🍑
 
Feature-aligned N-BEATS with Sinkhorn divergence (ICLR '24)
Feature-aligned N-BEATS with Sinkhorn divergence (ICLR '24)Feature-aligned N-BEATS with Sinkhorn divergence (ICLR '24)
Feature-aligned N-BEATS with Sinkhorn divergence (ICLR '24)
 
Asymmetry in the atmosphere of the ultra-hot Jupiter WASP-76 b
Asymmetry in the atmosphere of the ultra-hot Jupiter WASP-76 bAsymmetry in the atmosphere of the ultra-hot Jupiter WASP-76 b
Asymmetry in the atmosphere of the ultra-hot Jupiter WASP-76 b
 
TEST BANK For Radiologic Science for Technologists, 12th Edition by Stewart C...
TEST BANK For Radiologic Science for Technologists, 12th Edition by Stewart C...TEST BANK For Radiologic Science for Technologists, 12th Edition by Stewart C...
TEST BANK For Radiologic Science for Technologists, 12th Edition by Stewart C...
 
COST ESTIMATION FOR A RESEARCH PROJECT.pptx
COST ESTIMATION FOR A RESEARCH PROJECT.pptxCOST ESTIMATION FOR A RESEARCH PROJECT.pptx
COST ESTIMATION FOR A RESEARCH PROJECT.pptx
 
Kochi ❤CALL GIRL 84099*07087 ❤CALL GIRLS IN Kochi ESCORT SERVICE❤CALL GIRL
Kochi ❤CALL GIRL 84099*07087 ❤CALL GIRLS IN Kochi ESCORT SERVICE❤CALL GIRLKochi ❤CALL GIRL 84099*07087 ❤CALL GIRLS IN Kochi ESCORT SERVICE❤CALL GIRL
Kochi ❤CALL GIRL 84099*07087 ❤CALL GIRLS IN Kochi ESCORT SERVICE❤CALL GIRL
 
GBSN - Microbiology (Unit 3)
GBSN - Microbiology (Unit 3)GBSN - Microbiology (Unit 3)
GBSN - Microbiology (Unit 3)
 
American Type Culture Collection (ATCC).pptx
American Type Culture Collection (ATCC).pptxAmerican Type Culture Collection (ATCC).pptx
American Type Culture Collection (ATCC).pptx
 
Chemistry 4th semester series (krishna).pdf
Chemistry 4th semester series (krishna).pdfChemistry 4th semester series (krishna).pdf
Chemistry 4th semester series (krishna).pdf
 
Formation of low mass protostars and their circumstellar disks
Formation of low mass protostars and their circumstellar disksFormation of low mass protostars and their circumstellar disks
Formation of low mass protostars and their circumstellar disks
 
Proteomics: types, protein profiling steps etc.
Proteomics: types, protein profiling steps etc.Proteomics: types, protein profiling steps etc.
Proteomics: types, protein profiling steps etc.
 

Merging Models with the Epsilon Merging Language - A Decade Later

  • 1. Merging Models with the Epsilon Merging Language – A Decade Later Dimitris Kolovos, Richard Paige, and Fiona Polack Department of Computer Science University of York firstname.lastname@york.ac.uk D. Kolovos et. al. – ACM/IEEE MoDELS 2016 October 6, 2016 – Slide 1/23
  • 2. Ambition (in 2004) Develop a hybrid textual language for model merging In the same way that ATL targeted M2M, OCL targeted model validation etc. Desirable features Expressiveness Metamodel and modelling-technology independence Support for merging heterogeneous models D. Kolovos et. al. – ACM/IEEE MoDELS 2016 October 6, 2016 – Slide 2/23
  • 3. First Steps (2004–2005) Started with a version of the OCL grammar (ANTLR) and extended it with merging-specific syntax Wrote an interpreter for the AST Introduced an abstraction layer for modelling technologies Implemented the abstraction layer for the NetBeans MetaData Repository (MDR) – MOF 1.4 Implemented the first version of EML’s Eclipse-based development tools D. Kolovos et. al. – ACM/IEEE MoDELS 2016 October 6, 2016 – Slide 3/23
  • 4.
  • 5. Heterogeneous Model Merging? D. Kolovos et. al. – ACM/IEEE MoDELS 2016 October 6, 2016 – Slide 5/23
  • 6. Heterogeneous Model Merging? D. Kolovos et. al. – ACM/IEEE MoDELS 2016 October 6, 2016 – Slide 6/23
  • 7. Heterogeneous Model Merging? D. Kolovos et. al. – ACM/IEEE MoDELS 2016 October 6, 2016 – Slide 6/23
  • 8. Merging Process Focused on 2-way merging Steps 1 Establish correspondences between elements in the two models 2 Merge matching elements (optional) 3 Transform non-matching elements (optional) D. Kolovos et. al. – ACM/IEEE MoDELS 2016 October 6, 2016 – Slide 7/23
  • 9. Matching Elements Notes We establish correspondences based on national insurance number matching List!Person means: type “Person” from model “List” Inspired by ATL rule MatchPersonWithTaxPayer match p : List!Person with tp : HMRC!TaxPayer { compare: (p.country = "UK") and (p.taxId = tp.nin) } D. Kolovos et. al. – ACM/IEEE MoDELS 2016 October 6, 2016 – Slide 8/23
  • 10. Merging Elements Notes We merge matched Persons with their corresponding TaxPayers and produce (notification) Letters as output We don’t want to bother those whose incomes match rule DiscrepancyLetter merge p : List!Person with tp : HMRC!TaxPayer into l : Outbox!Letter { guard: tp.declaredIncome <> p.income l.address = tp.address; l.text = "Dear " + p.name + ", "; if (p.income > tp.declaredIncome) { l.text += "you are doomed."; } else { l.text += "we love you."; } } D. Kolovos et. al. – ACM/IEEE MoDELS 2016 October 6, 2016 – Slide 9/23
  • 11. Transforming Unmatched Elements Notes Unmatched Person elements from the UK means non-existing national insurance numbers (i.e. fraud!) rule FraudLetter transform p : List!Person into l : Outbox!Letter { guard: p.country == "UK" l.address = p.address; l.text = "You are doomed beyond imagination."; } D. Kolovos et. al. – ACM/IEEE MoDELS 2016 October 6, 2016 – Slide 10/23
  • 12. Modularisation An EML program consists of Matching rules Merging rules Transformation rules These are three different languages! . . . which share a common OCL-based imperative expression language, model connectivity facilities etc. D. Kolovos et. al. – ACM/IEEE MoDELS 2016 October 6, 2016 – Slide 11/23
  • 13. Modularisation An EML program consists of Matching rules Merging rules Transformation rules These are three four different languages! . . . which share model connectivity facilities etc. D. Kolovos et. al. – ACM/IEEE MoDELS 2016 October 6, 2016 – Slide 11/23
  • 14. Modularisation (2006) D. Kolovos et. al. – ACM/IEEE MoDELS 2016 October 6, 2016 – Slide 12/23
  • 15. Modularisation (2006) D. Kolovos et. al. – ACM/IEEE MoDELS 2016 October 6, 2016 – Slide 12/23
  • 16. Eclipse Modeling Project Epsilon joined the Eclipse Modeling GMT incubator in 2006 Graduated (v1.0) in 2012 Currently in v1.3 (v1.4 approved yesterday) Substantial boost to adoption ≈ 8,000 forum posts since 2008 In open-source projects and in industry To teach modelling and MDE courses http://eclipse.org/epsilon/users D. Kolovos et. al. – ACM/IEEE MoDELS 2016 October 6, 2016 – Slide 13/23
  • 17. Epsilon Validation Language (EVL) Key capabilities Human-readable messages Constraint dependencies Quick fixes context List!Person { constraint ValidNin { guard : self.country = "UK" check : HMRC!TaxPayer.all. exists(tp|self.taxId = tp.nin) message : "Unknown National Insurance Number: " + self.taxId } } D. Kolovos et. al. – ACM/IEEE MoDELS 2016 October 6, 2016 – Slide 15/23
  • 18. Epsilon Validation Language (EVL) context List!Person { constraint MatchingIncome { // Won’t be evaluated if ValidNin is not satisfied guard : self.satisfies("ValidNin") check { var taxPayer = HMRC!TaxPayer.all. selectOne(tp|self.taxId = tp.nin); return taxPayer.declaredIncome = self.income; } message : "Mismatching income: " + self.income + "<>" + taxPayer.declaredIncome } } D. Kolovos et. al. – ACM/IEEE MoDELS 2016 October 6, 2016 – Slide 16/23
  • 19. Epsilon Generation Language (EGL) Key capabilities Template-based M2T language Separate sub-language for rule-based template coordination Support for hand-written code in generated files rule EClass2DBClass transform c : EClass { guard : c.isAnnotatedAs("db") template : "eclass2dbclass.egl" target : c.name + ".java" } D. Kolovos et. al. – ACM/IEEE MoDELS 2016 October 6, 2016 – Slide 17/23
  • 20. Epsilon Generation Language (EGL) [%for (f in c.eStructuralFeatures.select(f|f.isMany)) { %] protected List<[%=f.eType.getJavaBoxedName()%]> [%=sf.name%] = null; [%}%] [%for (r in c.eReferences.select(r|not r.isMany)) { %] protected [%=r.eType.getJavaName()%] [%=r.name%] = null; [%}%] [%if (c.isAnnotatedAs("customize")){%] [% out.setContentType("Java"); %] // protected region custom-fields-and-methods on begin // protected region custom-fields-and-methods end [%}%] D. Kolovos et. al. – ACM/IEEE MoDELS 2016 October 6, 2016 – Slide 18/23
  • 21. Epsilon Pattern Language (EPL) Key capabilities Textual language for model pattern matching In-place transformation capabilities Matches exposed as a “virtual” model patterns → types, matches → elements, roles → properties pattern PublicField class : ClassDeclaration, field : FieldDeclaration from: class.bodyDeclarations, setter : MethodDeclaration from: class.bodyDeclarations guard: setter.name = "set" + field.getName(), getter : MethodDeclaration from: class.bodyDeclarations guard : (getter.name = "get" + field.getName() or getter.name = "is" + field.getName()) { } D. Kolovos et. al. – ACM/IEEE MoDELS 2016 October 6, 2016 – Slide 19/23
  • 22. Epsilon Pattern Language (EPL) context Patterns!PublicField { constraint GetterAndFieldSameType { check : self.getter.returnType.type = self.field.type.type message : "The getter of " + self.class.name + "." + self.field.fragments.at(0).name + " does not have the same type as" + " the field itself" } } D. Kolovos et. al. – ACM/IEEE MoDELS 2016 October 6, 2016 – Slide 20/23
  • 23. Epsilon (2004 - 2016) D. Kolovos et. al. – ACM/IEEE MoDELS 2016 October 6, 2016 – Slide 21/23
  • 24. Epsilon (2004 - 2016) D. Kolovos et. al. – ACM/IEEE MoDELS 2016 October 6, 2016 – Slide 21/23
  • 25. Epsilon (2004 - 2016) D. Kolovos et. al. – ACM/IEEE MoDELS 2016 October 6, 2016 – Slide 21/23
  • 26. Reflection EML was the first language tailored for model merging The 2006 MoDELS paper made the case for non-trivial merging of heterogeneous models EML was the seed from which Epsilon eventually grew EML is too verbose for merging homogeneous models . . . although homogeneous merging strategies can be trivially generated using HOTs EML turned out to be one of the least popular languages in Epsilon Little practical need for complex model merging? D. Kolovos et. al. – ACM/IEEE MoDELS 2016 October 6, 2016 – Slide 22/23
  • 27. Looking Ahead Incrementality Prototype for EGL → Robust implementation across Epsilon User experience Code completion, refactoring etc. Integration Enterprise Architect, MagicDraw etc. Optimisation e.g. technology-specific implementations of select() to avoid naive iteration and use indexes instead D. Kolovos et. al. – ACM/IEEE MoDELS 2016 October 6, 2016 – Slide 23/23