Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.
EMF Diff/Merge is a tool for merging models. More precisely, it is a technical component that can compare and merge sets of model elements. It consists in a diff/merge engine that is designed to prevent data loss and enforce model consistency during merge thanks to consistency rules. The project also provides GUI components and a set of applications.
It is intended to help develop merge-based features that are useful in model-based engineering. For example: model refactoring, iterative model transformations, bridges between modeling tools, collaborative modeling environments, versioning systems.
The EMF Diff/Merge project is part of EMF
Context and issues
Merging models is a common need in model-based activities, not only for version control of models but for model manipulation in general. However, it is a much more complex operation than merging source code. This is because models, in the EMF sense, are rich data structures constrained by a metamodel and sometimes subject to implicit engineering rules. Have you ever merged models in the past and obtained incorrect, unexpected or inconsistent results? This is what EMF Diff/Merge seeks to prevent.
The scope of EMF Diff/Merge covers:
- A lightweight, configurable engine for comparing and merging EMF-based models in 2-way and 3-way (with common ancestor) configurations.
- Matching of model elements by ID, where an ID can be any "signature" that uniquely identifies the element within its scope: Ecore ID, XML ID, qualified name, location in model tree, etc.
- A GUI with reusable components.
Among others, the tool exhibits the following characteristics:
- Comparison can be performed on any arbitrary model scope for versatility and scalability reasons.
- Interdependent differences are merged together in order to preserve model consistency.
- The order in which differences are merged has no impact.
- The global impact of a merge can be determined beforehand (picture above).
- Undo/redo of merges is supported.
Principle of the solution
The usage process is illustrated by the figure below. First, a comparison is created based on the models to compare. The differences between those models are computed according to given policies. Then, as long as differences remain, any subset of these differences can be selected for merging. Every time, predefined consistency rules and user-defined policies are used to compute the minimal superset of differences that must be merged to preserve consistency. The user may decide whether to confirm or cancel the merge of the whole set of differences.
For a description on how the objectives and the level of abstraction differ from EMF Compare, see the project proposal.
- Patterns: a technology for the declarative creation, application, evolution and management of modeling patterns
- Co-Evolution: a technology for model synchronization based on the merge mechanism
- Model Patch: a technology for recording, applying and persisting model modifications in a portable, model instance independent way
- Incremental transitions between engineering phases in Capella
- Reuse mechanism ("Replicable Elements") in Capella
- Overview at EclipseCon Europe 2012 - Modeling Symposium
- "New in Kepler" interview in June 2013 on JAXenter
- Presentation at Kepler Demo Camp Frankfurt am Main (2013)
- Presentation of applications: transformations, patterns, version control at EclipseCon France 2015 (video here)
- Ignite talk "What's new for Neon" at EclipseCon France 2016 (video here)
- Presentation of Model Patches at EclipseCon France 2017 (video here)
- Presentation of EMF Diff/Merge as part of A Guided Tour of Eclipse Modeling at the EclipseCon Europe 2017 Unconference
Click here for the Download page.
- Project summary: a summary of the current state of the project
- Project proposal: the original proposal for the project
- Forum: the dedicated newsgroup
- GitHub project: the source code on GitHub
- Build jobs: the location where the project is built
- Developer's guide: setting up a development environment for contributing