SlideShare a Scribd company logo
EclipseCon 2011




      What every developer
           EMF Compare ?



             Cédric Brun
             Obeo, France



copyright 2011 Obeo
in action!




●   SVN, CVS, GIT
●   UML, EMF, DSL's
●   History, Compare, Merge
Component of
                    EMF
●   Graduated
●   Stable API
●   pure Java JAR
●   Extensible
The Tool
How is it
Working ?
Matching Strategies

  XMI-ID                                                         GenericMatchEngine

options.put(MatchOptions.OPTION_IGNORE_XMI_ID, Boolean.FALSE);
MatchModel match = MatchService.doContentMatch(left,right options);




  ID-Attribute
options.put(MatchOptions.OPTION_IGNORE_ID, Boolean.FALSE);
MatchModel match = MatchService.doContentMatch(left,right options);




                                                defaults are XMI-ID, then ID-attributes and then reflective
Your own matching strategy



 public class AddressBookMatcher extends GenericMatchEngine {

 /**
  * {@inheritDoc}
  */
 @Override
 protected boolean isSimilar(EObject obj1, EObject obj2) throws FactoryException {
 /*
  * If we've got a People, only check the name similarity.
  */
 if (obj1 instanceof People || obj2 instanceof People)
 return nameDistance(obj1, obj2) > 0.8;
 /*
  * Contacts are similar if : the associated people is similar + their content is quite the same.
  */
 if (obj1 instanceof Contact && obj2 instanceof Contact) {
 EObject obj1Parent = obj1.eContainer();
 EObject obj2Parent = obj2.eContainer();
 if (obj1Parent instanceof People && obj2Parent instanceof People)
 return isSimilar(obj1Parent, obj2Parent) && contentDistance(obj1, obj2) > 0.5;
 }

 /*
  * If it's something we don't know about, then use the generic behavior.
  */
 return super.isSimilar(obj1, obj2);
 }
Comparing
People alice = createAlice();
v1Book.getPeoples().add(alice);

v2Book = EcoreUtil.copy(v1Book);

People bob = createBob();
v2Book.getPeoples().add(bob);




MatchModel match = new AddressBookMatcher().contentMatch(v1Book, v2Book, noOptions());

DiffModel delta = DiffService.doDiff(match);

DiffElement addbob = DiffHelper.isAdded(bob, delta);
assertNotNull("the addition of Bob has not been detected", addbob);
Merging




boolean mergeLeftToRight = true;
for (DiffElement diff : delta.getDifferences()) {
MergeService.merge(diff, mergeLeftToRight);
}

match = new AddressBookMatcher().contentMatch(v1Book, v2Book, noOptions());

delta = DiffService.doDiff(match);

assertEquals("We still have a difference whereas we merged all the diff elements", 0,
delta //$NON-NLS-1$
.getDifferences().size());
aliceLocal.setBirthday("07/05/84");
aliceRemote.setBirthday("07/07/84");

MatchModel match = new AddressBookMatcher().contentMatch(v2LocalBook, v2RemoteBook, v1Book,
noOptions());

DiffModel delta = DiffService.doDiff(match, true);
List<DiffElement> conflicts = new ArrayList<DiffElement>();

for (DiffElement diff : delta.getDifferences()) {
if (diff.isConflicting()) {
conflicts.add(diff);
}
}

assertEquals("We should have a conflict on Alice's birthday", 1, conflicts.size());
}
Exporting the delta.
Diff is a model => You can use Acceleo to generate code based on a diff
    e.g : SQL migration scripts based on a entity models comparison
Other usages we've
             heard of ?

Non regression Testing
    Selective assertEquals() on models

Transforming a destructive process in an incremental one
Using the diff + original version as an input for a process
Interactive Model Transformation
    Leveraging the UI + custom Match and Merge
What's
         cooking ?

                     ●   UML dedicated support
                     ●   Enhanced generic editor
                     ●   GMF and Papyrus Integration
References
 Website :
 ●

  ● http://www.eclipse.org/modeling/emf?project=compare

  ● http://wiki.eclipse.org/index.php/EMF ompare
                                        C
                                        _


 Support : EMF newsgroup and mailling list
 ●




 Downloads :
 ●

  ● Indigo Update Site

  ● Eclipse Modeling Package




 Source Code
 ●

  ● git://git.eclipse.org/gitroot/emfcompare/org.eclipse.emf.compare.git

More Related Content

Similar to What every developer should know about EMF Compare

Viking academy backbone.js
Viking academy  backbone.jsViking academy  backbone.js
Viking academy backbone.js
Bert Wijnants
 
Eugenia
EugeniaEugenia
Formatting ForThe Masses
Formatting ForThe MassesFormatting ForThe Masses
Formatting ForThe Masses
Holger Schill
 
Refactoring
RefactoringRefactoring
Refactoring
Amir Barylko
 
EclipseCon 2008: Fundamentals of the Eclipse Modeling Framework
EclipseCon 2008: Fundamentals of the Eclipse Modeling FrameworkEclipseCon 2008: Fundamentals of the Eclipse Modeling Framework
EclipseCon 2008: Fundamentals of the Eclipse Modeling Framework
Dave Steinberg
 
Advanced Dagger talk from 360andev
Advanced Dagger talk from 360andevAdvanced Dagger talk from 360andev
Advanced Dagger talk from 360andev
Mike Nakhimovich
 
Dojo Toolkit from a Flex developer's perspective
Dojo Toolkit from a Flex developer's perspectiveDojo Toolkit from a Flex developer's perspective
Dojo Toolkit from a Flex developer's perspective
cjolif
 
OpenDaylight Developer Experience 2.0
 OpenDaylight Developer Experience 2.0 OpenDaylight Developer Experience 2.0
OpenDaylight Developer Experience 2.0
Michael Vorburger
 
Adding a modern twist to legacy web applications
Adding a modern twist to legacy web applicationsAdding a modern twist to legacy web applications
Adding a modern twist to legacy web applications
Jeff Durta
 
[E-Dev-Day 2014][4/16] Review of Eolian, Eo, Bindings, Interfaces and What's ...
[E-Dev-Day 2014][4/16] Review of Eolian, Eo, Bindings, Interfaces and What's ...[E-Dev-Day 2014][4/16] Review of Eolian, Eo, Bindings, Interfaces and What's ...
[E-Dev-Day 2014][4/16] Review of Eolian, Eo, Bindings, Interfaces and What's ...
EnlightenmentProject
 
IOC + Javascript
IOC + JavascriptIOC + Javascript
IOC + Javascript
Brian Cavalier
 
Refactoring
RefactoringRefactoring
Refactoring
Amir Barylko
 
Koin Quickstart
Koin QuickstartKoin Quickstart
Koin Quickstart
Matthew Clarke
 
iOS overview
iOS overviewiOS overview
iOS overview
gupta25
 
Front End Development: The Important Parts
Front End Development: The Important PartsFront End Development: The Important Parts
Front End Development: The Important Parts
Sergey Bolshchikov
 
JavaScript Miller Columns
JavaScript Miller ColumnsJavaScript Miller Columns
JavaScript Miller Columns
Jonathan Fine
 
An Introduction to the SOLID Principles
An Introduction to the SOLID PrinciplesAn Introduction to the SOLID Principles
An Introduction to the SOLID Principles
Attila Bertók
 
Web technologies-course 12.pptx
Web technologies-course 12.pptxWeb technologies-course 12.pptx
Web technologies-course 12.pptx
Stefan Oprea
 
HTML5 for the Silverlight Guy
HTML5 for the Silverlight GuyHTML5 for the Silverlight Guy
HTML5 for the Silverlight Guy
David Padbury
 
Tdd is not about testing
Tdd is not about testingTdd is not about testing
Tdd is not about testing
Gianluca Padovani
 

Similar to What every developer should know about EMF Compare (20)

Viking academy backbone.js
Viking academy  backbone.jsViking academy  backbone.js
Viking academy backbone.js
 
Eugenia
EugeniaEugenia
Eugenia
 
Formatting ForThe Masses
Formatting ForThe MassesFormatting ForThe Masses
Formatting ForThe Masses
 
Refactoring
RefactoringRefactoring
Refactoring
 
EclipseCon 2008: Fundamentals of the Eclipse Modeling Framework
EclipseCon 2008: Fundamentals of the Eclipse Modeling FrameworkEclipseCon 2008: Fundamentals of the Eclipse Modeling Framework
EclipseCon 2008: Fundamentals of the Eclipse Modeling Framework
 
Advanced Dagger talk from 360andev
Advanced Dagger talk from 360andevAdvanced Dagger talk from 360andev
Advanced Dagger talk from 360andev
 
Dojo Toolkit from a Flex developer's perspective
Dojo Toolkit from a Flex developer's perspectiveDojo Toolkit from a Flex developer's perspective
Dojo Toolkit from a Flex developer's perspective
 
OpenDaylight Developer Experience 2.0
 OpenDaylight Developer Experience 2.0 OpenDaylight Developer Experience 2.0
OpenDaylight Developer Experience 2.0
 
Adding a modern twist to legacy web applications
Adding a modern twist to legacy web applicationsAdding a modern twist to legacy web applications
Adding a modern twist to legacy web applications
 
[E-Dev-Day 2014][4/16] Review of Eolian, Eo, Bindings, Interfaces and What's ...
[E-Dev-Day 2014][4/16] Review of Eolian, Eo, Bindings, Interfaces and What's ...[E-Dev-Day 2014][4/16] Review of Eolian, Eo, Bindings, Interfaces and What's ...
[E-Dev-Day 2014][4/16] Review of Eolian, Eo, Bindings, Interfaces and What's ...
 
IOC + Javascript
IOC + JavascriptIOC + Javascript
IOC + Javascript
 
Refactoring
RefactoringRefactoring
Refactoring
 
Koin Quickstart
Koin QuickstartKoin Quickstart
Koin Quickstart
 
iOS overview
iOS overviewiOS overview
iOS overview
 
Front End Development: The Important Parts
Front End Development: The Important PartsFront End Development: The Important Parts
Front End Development: The Important Parts
 
JavaScript Miller Columns
JavaScript Miller ColumnsJavaScript Miller Columns
JavaScript Miller Columns
 
An Introduction to the SOLID Principles
An Introduction to the SOLID PrinciplesAn Introduction to the SOLID Principles
An Introduction to the SOLID Principles
 
Web technologies-course 12.pptx
Web technologies-course 12.pptxWeb technologies-course 12.pptx
Web technologies-course 12.pptx
 
HTML5 for the Silverlight Guy
HTML5 for the Silverlight GuyHTML5 for the Silverlight Guy
HTML5 for the Silverlight Guy
 
Tdd is not about testing
Tdd is not about testingTdd is not about testing
Tdd is not about testing
 

More from Cédric Brun

Integrating Xtext and Sirius: Strategies and Pitfalls
Integrating Xtext and Sirius: Strategies and PitfallsIntegrating Xtext and Sirius: Strategies and Pitfalls
Integrating Xtext and Sirius: Strategies and Pitfalls
Cédric Brun
 
Eclipse Modeling Guided Tour - EMF Compare
Eclipse Modeling Guided Tour - EMF CompareEclipse Modeling Guided Tour - EMF Compare
Eclipse Modeling Guided Tour - EMF Compare
Cédric Brun
 
Eclipse Modeling Guided Tour - Acceleo Query Language (AQL)
Eclipse Modeling Guided Tour - Acceleo Query Language (AQL)Eclipse Modeling Guided Tour - Acceleo Query Language (AQL)
Eclipse Modeling Guided Tour - Acceleo Query Language (AQL)
Cédric Brun
 
Eclipse Modeling Guided Tour - EcoreTools
Eclipse Modeling Guided Tour - EcoreToolsEclipse Modeling Guided Tour - EcoreTools
Eclipse Modeling Guided Tour - EcoreTools
Cédric Brun
 
EcoreTools-Next: Executable DSL made (more) accessible
EcoreTools-Next: Executable DSL made (more) accessibleEcoreTools-Next: Executable DSL made (more) accessible
EcoreTools-Next: Executable DSL made (more) accessible
Cédric Brun
 
Integrating Xtext and Sirius: Strategies and Pitfalls
Integrating  Xtext and Sirius:  Strategies and PitfallsIntegrating  Xtext and Sirius:  Strategies and Pitfalls
Integrating Xtext and Sirius: Strategies and Pitfalls
Cédric Brun
 
Roadmap - SiriusCon2016
Roadmap - SiriusCon2016Roadmap - SiriusCon2016
Roadmap - SiriusCon2016
Cédric Brun
 
Modeling avengers – open source technology mix for saving the world econ fr
Modeling avengers – open source technology mix for saving the world econ frModeling avengers – open source technology mix for saving the world econ fr
Modeling avengers – open source technology mix for saving the world econ fr
Cédric Brun
 
Modeling avengers – open source technology mix for saving the world
Modeling avengers – open source technology mix for saving the worldModeling avengers – open source technology mix for saving the world
Modeling avengers – open source technology mix for saving the world
Cédric Brun
 
15 EMF projects in 25 minutes
15 EMF projects in 25 minutes15 EMF projects in 25 minutes
15 EMF projects in 25 minutes
Cédric Brun
 
What the heck is Eclipse Modeling and why should you care !
What the heck is Eclipse Modeling and why should you care !What the heck is Eclipse Modeling and why should you care !
What the heck is Eclipse Modeling and why should you care !
Cédric Brun
 
Breathe life into your designer!
Breathe life into your designer!Breathe life into your designer!
Breathe life into your designer!
Cédric Brun
 
Sirius : origins, present, future
Sirius : origins, present, futureSirius : origins, present, future
Sirius : origins, present, future
Cédric Brun
 
Xtext + Sirius = ♥ / EclipseCon Europe 2014
Xtext + Sirius = ♥  / EclipseCon Europe 2014Xtext + Sirius = ♥  / EclipseCon Europe 2014
Xtext + Sirius = ♥ / EclipseCon Europe 2014
Cédric Brun
 
Xtext + Sirius = &lt;3
Xtext + Sirius = &lt;3Xtext + Sirius = &lt;3
Xtext + Sirius = &lt;3
Cédric Brun
 
Ecore Tools 2.0 : The Luna Revival
Ecore Tools 2.0 : The Luna RevivalEcore Tools 2.0 : The Luna Revival
Ecore Tools 2.0 : The Luna Revival
Cédric Brun
 
Sirius Role Playing Game - Build diagram, table and tree editors in 20 minutes
Sirius Role Playing Game  - Build diagram, table and tree editors in 20 minutesSirius Role Playing Game  - Build diagram, table and tree editors in 20 minutes
Sirius Role Playing Game - Build diagram, table and tree editors in 20 minutes
Cédric Brun
 
From Acceleo.org To Eclipse Modeling
From Acceleo.org To Eclipse ModelingFrom Acceleo.org To Eclipse Modeling
From Acceleo.org To Eclipse Modeling
Cédric Brun
 
Acceleo Day - Acceleo Mtl Code Generation
Acceleo Day - Acceleo Mtl Code GenerationAcceleo Day - Acceleo Mtl Code Generation
Acceleo Day - Acceleo Mtl Code GenerationCédric Brun
 
Team Work With Models Web
Team Work With Models WebTeam Work With Models Web
Team Work With Models Web
Cédric Brun
 

More from Cédric Brun (20)

Integrating Xtext and Sirius: Strategies and Pitfalls
Integrating Xtext and Sirius: Strategies and PitfallsIntegrating Xtext and Sirius: Strategies and Pitfalls
Integrating Xtext and Sirius: Strategies and Pitfalls
 
Eclipse Modeling Guided Tour - EMF Compare
Eclipse Modeling Guided Tour - EMF CompareEclipse Modeling Guided Tour - EMF Compare
Eclipse Modeling Guided Tour - EMF Compare
 
Eclipse Modeling Guided Tour - Acceleo Query Language (AQL)
Eclipse Modeling Guided Tour - Acceleo Query Language (AQL)Eclipse Modeling Guided Tour - Acceleo Query Language (AQL)
Eclipse Modeling Guided Tour - Acceleo Query Language (AQL)
 
Eclipse Modeling Guided Tour - EcoreTools
Eclipse Modeling Guided Tour - EcoreToolsEclipse Modeling Guided Tour - EcoreTools
Eclipse Modeling Guided Tour - EcoreTools
 
EcoreTools-Next: Executable DSL made (more) accessible
EcoreTools-Next: Executable DSL made (more) accessibleEcoreTools-Next: Executable DSL made (more) accessible
EcoreTools-Next: Executable DSL made (more) accessible
 
Integrating Xtext and Sirius: Strategies and Pitfalls
Integrating  Xtext and Sirius:  Strategies and PitfallsIntegrating  Xtext and Sirius:  Strategies and Pitfalls
Integrating Xtext and Sirius: Strategies and Pitfalls
 
Roadmap - SiriusCon2016
Roadmap - SiriusCon2016Roadmap - SiriusCon2016
Roadmap - SiriusCon2016
 
Modeling avengers – open source technology mix for saving the world econ fr
Modeling avengers – open source technology mix for saving the world econ frModeling avengers – open source technology mix for saving the world econ fr
Modeling avengers – open source technology mix for saving the world econ fr
 
Modeling avengers – open source technology mix for saving the world
Modeling avengers – open source technology mix for saving the worldModeling avengers – open source technology mix for saving the world
Modeling avengers – open source technology mix for saving the world
 
15 EMF projects in 25 minutes
15 EMF projects in 25 minutes15 EMF projects in 25 minutes
15 EMF projects in 25 minutes
 
What the heck is Eclipse Modeling and why should you care !
What the heck is Eclipse Modeling and why should you care !What the heck is Eclipse Modeling and why should you care !
What the heck is Eclipse Modeling and why should you care !
 
Breathe life into your designer!
Breathe life into your designer!Breathe life into your designer!
Breathe life into your designer!
 
Sirius : origins, present, future
Sirius : origins, present, futureSirius : origins, present, future
Sirius : origins, present, future
 
Xtext + Sirius = ♥ / EclipseCon Europe 2014
Xtext + Sirius = ♥  / EclipseCon Europe 2014Xtext + Sirius = ♥  / EclipseCon Europe 2014
Xtext + Sirius = ♥ / EclipseCon Europe 2014
 
Xtext + Sirius = &lt;3
Xtext + Sirius = &lt;3Xtext + Sirius = &lt;3
Xtext + Sirius = &lt;3
 
Ecore Tools 2.0 : The Luna Revival
Ecore Tools 2.0 : The Luna RevivalEcore Tools 2.0 : The Luna Revival
Ecore Tools 2.0 : The Luna Revival
 
Sirius Role Playing Game - Build diagram, table and tree editors in 20 minutes
Sirius Role Playing Game  - Build diagram, table and tree editors in 20 minutesSirius Role Playing Game  - Build diagram, table and tree editors in 20 minutes
Sirius Role Playing Game - Build diagram, table and tree editors in 20 minutes
 
From Acceleo.org To Eclipse Modeling
From Acceleo.org To Eclipse ModelingFrom Acceleo.org To Eclipse Modeling
From Acceleo.org To Eclipse Modeling
 
Acceleo Day - Acceleo Mtl Code Generation
Acceleo Day - Acceleo Mtl Code GenerationAcceleo Day - Acceleo Mtl Code Generation
Acceleo Day - Acceleo Mtl Code Generation
 
Team Work With Models Web
Team Work With Models WebTeam Work With Models Web
Team Work With Models Web
 

Recently uploaded

Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
BookNet Canada
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
OnBoard
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
RTTS
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
Safe Software
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
Elena Simperl
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
DianaGray10
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
Product School
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
Frank van Harmelen
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
Elena Simperl
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
Thijs Feryn
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
Sri Ambati
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
Product School
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
Cheryl Hung
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
UiPathCommunity
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Product School
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
Product School
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
Alison B. Lowndes
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
James Anderson
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
Product School
 

Recently uploaded (20)

Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
 

What every developer should know about EMF Compare

  • 1. EclipseCon 2011 What every developer EMF Compare ? Cédric Brun Obeo, France copyright 2011 Obeo
  • 2. in action! ● SVN, CVS, GIT ● UML, EMF, DSL's ● History, Compare, Merge
  • 3. Component of EMF ● Graduated ● Stable API ● pure Java JAR ● Extensible
  • 6.
  • 7. Matching Strategies XMI-ID GenericMatchEngine options.put(MatchOptions.OPTION_IGNORE_XMI_ID, Boolean.FALSE); MatchModel match = MatchService.doContentMatch(left,right options); ID-Attribute options.put(MatchOptions.OPTION_IGNORE_ID, Boolean.FALSE); MatchModel match = MatchService.doContentMatch(left,right options); defaults are XMI-ID, then ID-attributes and then reflective
  • 8. Your own matching strategy public class AddressBookMatcher extends GenericMatchEngine { /** * {@inheritDoc} */ @Override protected boolean isSimilar(EObject obj1, EObject obj2) throws FactoryException { /* * If we've got a People, only check the name similarity. */ if (obj1 instanceof People || obj2 instanceof People) return nameDistance(obj1, obj2) > 0.8; /* * Contacts are similar if : the associated people is similar + their content is quite the same. */ if (obj1 instanceof Contact && obj2 instanceof Contact) { EObject obj1Parent = obj1.eContainer(); EObject obj2Parent = obj2.eContainer(); if (obj1Parent instanceof People && obj2Parent instanceof People) return isSimilar(obj1Parent, obj2Parent) && contentDistance(obj1, obj2) > 0.5; } /* * If it's something we don't know about, then use the generic behavior. */ return super.isSimilar(obj1, obj2); }
  • 9. Comparing People alice = createAlice(); v1Book.getPeoples().add(alice); v2Book = EcoreUtil.copy(v1Book); People bob = createBob(); v2Book.getPeoples().add(bob); MatchModel match = new AddressBookMatcher().contentMatch(v1Book, v2Book, noOptions()); DiffModel delta = DiffService.doDiff(match); DiffElement addbob = DiffHelper.isAdded(bob, delta); assertNotNull("the addition of Bob has not been detected", addbob);
  • 10. Merging boolean mergeLeftToRight = true; for (DiffElement diff : delta.getDifferences()) { MergeService.merge(diff, mergeLeftToRight); } match = new AddressBookMatcher().contentMatch(v1Book, v2Book, noOptions()); delta = DiffService.doDiff(match); assertEquals("We still have a difference whereas we merged all the diff elements", 0, delta //$NON-NLS-1$ .getDifferences().size());
  • 11. aliceLocal.setBirthday("07/05/84"); aliceRemote.setBirthday("07/07/84"); MatchModel match = new AddressBookMatcher().contentMatch(v2LocalBook, v2RemoteBook, v1Book, noOptions()); DiffModel delta = DiffService.doDiff(match, true); List<DiffElement> conflicts = new ArrayList<DiffElement>(); for (DiffElement diff : delta.getDifferences()) { if (diff.isConflicting()) { conflicts.add(diff); } } assertEquals("We should have a conflict on Alice's birthday", 1, conflicts.size()); }
  • 12. Exporting the delta. Diff is a model => You can use Acceleo to generate code based on a diff e.g : SQL migration scripts based on a entity models comparison
  • 13. Other usages we've heard of ? Non regression Testing Selective assertEquals() on models Transforming a destructive process in an incremental one Using the diff + original version as an input for a process Interactive Model Transformation Leveraging the UI + custom Match and Merge
  • 14. What's cooking ? ● UML dedicated support ● Enhanced generic editor ● GMF and Papyrus Integration
  • 15. References Website : ● ● http://www.eclipse.org/modeling/emf?project=compare ● http://wiki.eclipse.org/index.php/EMF ompare C _ Support : EMF newsgroup and mailling list ● Downloads : ● ● Indigo Update Site ● Eclipse Modeling Package Source Code ● ● git://git.eclipse.org/gitroot/emfcompare/org.eclipse.emf.compare.git