Version Control in MDE - Diagram Predicate Framework

Transcription

Version Control in MDE - Diagram Predicate Framework
Version Control in MDE
Version Control in MDE
Adrian Rutle1 , Alessandro Rossini2 , Yngve Lamo1 , Uwe Wolter2
1 Faculty
of Engineering, Bergen University College, Norway
2 Department
of Informatics, University of Bergen, Norway
20 November 2008
Version Control in MDE
Introduction and Motivation
Outline
1 Introduction and Motivation
2 Version Control in MDE
Concurrent Development in MDE
Common Model
Merge Model
Synchronisation and Commit
Difference and Conflict
3 Summary and Future Work
Version Control in MDE
Introduction and Motivation
Model-Driven Engineering
Model-Driven Engineering (MDE)
models as primary artefacts of the software development
process
Models undergo a complex evolution during their life cycles
need for techniques and tools to support model evolution
activities
Version control enables concurrent and distributed software
development
Version Control in MDE
Introduction and Motivation
Version Control Paradigms
Lock-Modify-Unlock
lock an artefact
modify it
release the lock
Copy-Modify-Merge
create a local copy of the repository
modify the local copy independently
detect conflicting changes
merge the modifications into the repository
Version Control in MDE
Introduction and Motivation
Motivation
Lock-modify-unlock is workable if the developers always know
who is planning to do what
Traditional copy-modify-merge systems are focused on the
management of text-based files
techniques based on per-line comparison
not suitable for graph-based structures
Adoption of the copy-modify-merge paradigm enables effective
version control in MDE
Version Control in MDE
Introduction and Motivation
Motivation
Solutions proposed by research are not sufficient to enable
version control in MDE
lack of mature techniques targeting graph-based structures
same operations are given different semantics in different
works/tools
concepts are described only semiformally
terminology is not precise and unique
Version Control in MDE
Introduction and Motivation
Our contribution
Formalisation of the copy-modify-merge paradigm in MDE
Definition of common models and merge models by means of
pullback and pushout constructions respectively
Representation of model differences and detection of syntactic
conflicts by using Diagram Predicate Framework (DPF)
Version Control in MDE
Version Control in MDE
Concurrent Development in MDE
Outline
1 Introduction and Motivation
2 Version Control in MDE
Concurrent Development in MDE
Common Model
Merge Model
Synchronisation and Commit
Difference and Conflict
3 Summary and Future Work
Version Control in MDE
Version Control in MDE
Concurrent Development in MDE
Example
Repository
Timeline
Alice’s local copy
Bob’s local copy
Version Control in MDE
Version Control in MDE
Concurrent Development in MDE
Example
Repository
Timeline
Alice’s local copy
Bob’s local copy
Version Control in MDE
Version Control in MDE
Concurrent Development in MDE
Example
Repository
Timeline
Alice’s local copy
Bob’s local copy
Version Control in MDE
Version Control in MDE
Concurrent Development in MDE
Example
Repository
Timeline
Alice’s local copy
Bob’s local copy
Version Control in MDE
Version Control in MDE
Concurrent Development in MDE
Example
Repository
Timeline
Alice’s local copy
Bob’s local copy
Version Control in MDE
Version Control in MDE
Concurrent Development in MDE
Example
Repository
Timeline
Alice’s local copy
Bob’s local copy
Version Control in MDE
Version Control in MDE
Concurrent Development in MDE
Example
Repository
Timeline
Alice’s local copy
Bob’s local copy
Version Control in MDE
Version Control in MDE
Concurrent Development in MDE
Example
Repository
Timeline
Alice’s local copy
Bob’s local copy
Version Control in MDE
Version Control in MDE
Concurrent Development in MDE
Example
Repository
Timeline
Alice’s local copy
Bob’s local copy
Version Control in MDE
Version Control in MDE
Common Model
Outline
1 Introduction and Motivation
2 Version Control in MDE
Concurrent Development in MDE
Common Model
Merge Model
Synchronisation and Commit
Difference and Conflict
3 Summary and Future Work
Version Control in MDE
Version Control in MDE
Common Model
Common Model
The development environment must keep track over what is
common between subsequent models
Existing approaches to the identification of
mappings/differences
soft-linking: structurally equivalent elements imply equal
elements
hard-linking: elements with equal identifiers are seen as equal
elements
Version Control in MDE
Version Control in MDE
Common Model
Common Model
We tackle the identification of mappings by specifying them
explicitly in common models
“Recording” which elements are kept unmodified addresses
the problems of the soft- and hard-linking approaches
Definition
A model C together with the injective morphism inj and the
inclusion morphism inc is a common model for Vi and Vj .
C
inj
Vi
inc
Vj
Version Control in MDE
Version Control in MDE
Common Model
Example
Version Control in MDE
Version Control in MDE
Common Model
Composition of Common Models
Common model of non-subsequent models can be obtained by
the composition of the “intermediate” common models
Definition
The composition of commons Ci,k is a special pullback
(Ci,k , injCi,j , incCj,k ) of the diagram Ci,j
such that incCj,k is an inclusion
Ci,k
f
Ci,j
Vi
P.B.
incV
injV
j
j
Vj
Vj
g
incC
injC
i,j
injV
i
incVj
j,k
Cj,k
incV
k
Vk
injVj
Cj,k
Version Control in MDE
Version Control in MDE
Merge Model
Outline
1 Introduction and Motivation
2 Version Control in MDE
Concurrent Development in MDE
Common Model
Merge Model
Synchronisation and Commit
Difference and Conflict
3 Summary and Future Work
Version Control in MDE
Version Control in MDE
Merge Model
Merge Model
The merge model must contain the information which is
needed to distinguish which model elements come from which
“source” model
This is exactly one of the properties of pushout
Definition
The merge model Vi,j is the pushout (Vi,j , mi , mj ) of the
diagram Vi
injVi
Ci,j
incVj
Vj such that mj is an inclusion.
Ci,j
incV
injV
i
Vi
Vj
P.O.
mi
mj
Vi,j
j
Version Control in MDE
Version Control in MDE
Merge Model
Example
Version Control in MDE
Version Control in MDE
Synchronisation and Commit
Outline
1 Introduction and Motivation
2 Version Control in MDE
Concurrent Development in MDE
Common Model
Merge Model
Synchronisation and Commit
Difference and Conflict
3 Summary and Future Work
Version Control in MDE
Version Control in MDE
Synchronisation and Commit
Synchronisation and Commit
A synchronisation is a procedure which generates a
synchronised local copy Vj U , where Vj is the last version in
the repository
conflicting changes are detected
A commit is an operation which adds the model Vj U to the
repository and labels it Vj+1
Version Control in MDE
Version Control in MDE
Synchronisation and Commit
Synchronisation Procedure
Ci,i U
incV
Vi U
mui U
Ci,j
injVi
iU
ei U
P.O.
Vi,i U
incVj
injVi
Vi
mui
Vj
...
mri
P.O.
mui U ,i
P.O.
Vi,j
mri,j
Vi U ,j
mrj
Vj U
Vj+1
ci U
Version Control in MDE
Version Control in MDE
Difference and Conflict
Outline
1 Introduction and Motivation
2 Version Control in MDE
Concurrent Development in MDE
Common Model
Merge Model
Synchronisation and Commit
Difference and Conflict
3 Summary and Future Work
Version Control in MDE
Version Control in MDE
Difference and Conflict
Difference
Need to identify the differences between two models
In a merge model Vi U ,j we can distinguish common elements,
Vi U -elements and Vj -elements from each other
We can identify which elements are common, added, deleted,
renamed and moved
We define a signature Σ∆
predicates: [common], [add], [delete], [rename], [move],
and [conflict]
Version Control in MDE
Version Control in MDE
Difference and Conflict
Conflict
The merge models will be decorated by predicates from the
signature Σ∆
detection of conflicts in the decorated merge model Vi U ,j
reduction of Vi U ,j to Vj U
Rules:
[common] ∧ [common] → [common]
[delete] ∧ [delete] → [delete]
[common] ∧ [delete] → [delete]
[move] ∧ [move] → [conflict]
[add] (arrow) ∧ [delete] (node) → [conflict]
[rename] ∧ [rename] → [conflict]
Version Control in MDE
Version Control in MDE
Difference and Conflict
Example
Version Control in MDE
Summary and Future Work
Outline
1 Introduction and Motivation
2 Version Control in MDE
Concurrent Development in MDE
Common Model
Merge Model
Synchronisation and Commit
Difference and Conflict
3 Summary and Future Work
Version Control in MDE
Summary and Future Work
Summary
The copy-modify-merge paradigm can be exploited for version
control of graph-based structures
Formalisation of the concepts of the copy-modify-merge
paradigm in MDE by means of category-theoretical
constructions
Explicit specification of model elements’ mappings in common
models
Diagrammatic language for the representation of model
differences
Rules for the detection of syntactic conflicts
Version Control in MDE
Summary and Future Work
Future Work
Semantic conflicts
Prototype implementation
Version Control in MDE
Summary and Future Work
Thank you!
Questions?

Similar documents