Skip to main content
Log in

Merging of EMF models

Formal foundations

  • Theme Section Paper
  • Published:
Software & Systems Modeling Aims and scope Submit manuscript

Abstract

Inadequate version control for models significantly impedes the application of model-driven software development. In particular, sophisticated support for merging model versions is urgently needed. In this paper, we present a formal approach to both two- and three-way merging of models in the EMF framework. The approach may be applied to instances of arbitrary Ecore models. We specify context-free as well as context-sensitive rules for model merging which both detect and resolve merge conflicts. Based on these rules, a merge algorithm is developed which produces a consistent model from consistent input models. The merge algorithm does neither assume unique object identifiers, nor does it require change logs. In contrast, it relies on matchings among the input models which identify common elements (state-based approach). The requirements imposed on these matchings are reduced to a minimum, e.g., there are no restrictions on the relative positions of matched elements. Altogether, the merge algorithm is widely applicable, preserves consistency, and offers advanced features, such as merging of ordered collections in the presence of arbitrary moves and handling of context-sensitive conflicts which are hard to detect and to resolve.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Fig. 1
Fig. 2
Fig. 3
Fig. 4
Fig. 5
Fig. 6
Fig. 7
Fig. 8
Fig. 9
Fig. 10
Fig. 11

Similar content being viewed by others

Notes

  1. \(\bot \) denotes an undefined result.

  2. http://download.eclipse.org/modeling/emf/emf/javadoc/2.5.0/org/eclipse/emf/ecore/package-summary.html#details.

  3. For some set \(S\), \(SET(S)\) denotes the set of sets over \(S\).

  4. We use the notation \(o_2 \in fv(o_1)\) also for single-valued features.

  5. An undirected edge is a set \(\{e_1, e_2\}\). In the conditions below, we will write \(e_1 \leftrightarrow e_2\) as a shorthand for \(\{e_1, e_2\} \in M\).

  6. \(O_b\), \(O_1\), and \(O_2\) denote the object sets of the input versions \(b\), \(a_1\), and \(a_2\), respectively.

  7. We reuse the predicates \(n-way(o, cf)\) introduced for the merging of single-valued features. Furthermore, \(b \in \mathbb B \).

  8. A directed graph is a pair \(g = (V, E)\), where \(V\) is a finite set of nodes and \(E \subseteq V \times V\) is a set of directed edges.

  9. In the conditions below, \(v \rightarrow v^{\prime }\) and \(v \xrightarrow {+} v^{\prime }\) stand for \((v, v^{\prime }) \in E\) and \((v, v^{\prime }) \in E^+\), respectively; \(^+\) denotes transitive closure.

  10. This predicate may be defined on the merged model graph by checking the visibilities of elements reachable from the root of the superimposed trees.

  11. \(\xrightarrow {c^*}\) denotes the reflective and transitive closure over containment links.

  12. We assume that the target type of the reference \(xr_1\) is \(C_4\) and \(C_4\) does not conform to \(C_5\).

References

  1. Alanen, M., Porres, I.: Difference and union of models. In: Stevens, P., Whittle, J., Booch, G. (eds.) UML 2003—The Unified Modeling Language, Modeling Languages and Applications, 6th International Conference. Lecture Notes in Computer Science, San Francisco, CA, vol. 2863, pp. 2–17. Springer, Berlin (2003)

  2. Altmanninger, K., Schwinger, W., Kotsis, G.: Semantics for accurate conflict detection in SMoVer: specification, detection and presentation by example. Int. J. Enterp. Inf. Syst. 6(1), 68–84 (2010)

    Article  Google Scholar 

  3. Altmanninger, K., Seidl, M., Wimmer, M.: A survey on model versioning approaches. Int. J. Web Inf. Syst. 5(3), 271–304 (2009)

    Google Scholar 

  4. Amelunxen, C., Königs, A., Rötschke, T., Schürr, A.: MOFLON: A standard-compliant metamodeling framework with graph transformations. In: Rensink, A., Warmer, J. (eds.) Proceedings of the Second European Conference on Model Driven Architecture—Foundations and Applications (ECMDA-FA 2006). Lecture Notes in Computer Science, Bilbao, Spain, vol. 4066. Springer, Berlin, pp. 361–375 (2006)

  5. Andries, M., Engels, G., Habel, A., Hoffmann, B., Kreowski, H.-J., Kuske, S., Plump, D., Schürr, A., Taentzer, G.: Graph transformation for specification and programming. Sci. Comput. Programm. 34(1), 1–54 (1999)

    Google Scholar 

  6. Bartelt, C.: Consistence preserving model merge in collaborative development processes. In: Ebert, J., Kelter, U., Systä, T. (eds.) Proceedings of the 2008 International Workshop on Comparison and Versioning of Software Models (CVSM 2008), Leipzig, Germany. ACM Press, New York, pp. 13–18 (2008)

  7. Boronat, A., Carsí, J.A., Ramos, I., Letelier, P.: Formal model merging applied to class diagram integration. Electron. Notes Theoret. Comput. Sci. 166, 5–26 (2007)

    Article  Google Scholar 

  8. Brun, C., Pierantonio, A.: Model differences in the Eclipse Modelling Framework. UPGRADE IX(2), 29–34 (2008)

    Google Scholar 

  9. Cicchetti, A., Di Ruscio, D., Pierantonio, A.: Managing model conflicts in distributed development. In: Czarnecki, K., Ober, I., Bruel, J.-M., Uhl, A., Völter, M. (eds.) Proceedings of the 11th International Conference on Model Driven Engineering Languages and Systems (MoDELS 2008). Lecture Notes in Computer Science, Toulouse, France, vol. 5301, pp. 311–325. Springer, Berlin (2008)

  10. Collins-Sussman, B., Fitzpatrick, B.W., Pilato, C.M.: Version Control with Subversion. O’Reilly& Associates, Sebastopol (2004)

    Google Scholar 

  11. Conradi, R., Westfechtel, B.: Version models for software configuration management. ACM Comput. Surv. 30(2), 232–282 (1998)

    Article  Google Scholar 

  12. Deußer, R.: 3-Wege-Merge auf Instanzen MOF-konformer Metamodelle. Technical University of Darmstadt, Darmstadt, Germany, Master’s thesis (2008)

  13. Ebert, J., Kelter, U., Systä, T. (eds.) Proceedings of the 2008 International Workshop on Comparison and Versioning of Software Models (CVSM 2008), Leipzig, Germany. ACM Press, New York (2008)

  14. Ehrig, H., Ermel, C., Taentzer, G.: A formal resolution strategy for operation-based conflicts in model versioning using graph modifications. In: Giannakopoulo, D., Orejas, F. (eds.) FASE 2011—14th International Conference on Fundamental Approaches to Software Engineering. Lecture Notes in Computer Science, Saarbrücken, Germany, vol. 6603, pp. 202–216. Springer, Berlin (2011)

  15. Engel, K.-D., Paige, R.F., Kolovos, D.S.: Using a model merging language for reconciling model versions. In: Rensink, A., Warmer, J. (eds.) Proceedings of the Second European Conference on Model Driven Architecture—Foundations and Applications (ECMDA-FA 2006). Lecture Notes in Computer Science, Bilbao, Spain, vol. 4066. Springer, Berlin, pp. 143–157 (2006)

  16. Förtsch, S., Westfechtel, B.: Differencing and merging of software diagrams—state of the art and challenges. In: Filipe, J., Helfert, M., Shishkov, B. (eds.) Proceedings of the Second International Conference on Software and Data Technologies (ICSOFT 2007), Barcelona, Spain, pp. 90–99. INSTICC Press, Valencia (2007)

  17. Hunt, J.W., Szymanski, T.G.: A fast algorithm for computing longest common subsequences. Commun. ACM 20(5), 350–353 (1977)

    Article  MATH  MathSciNet  Google Scholar 

  18. Kelter, U., Wehren, J., Niere, J.: A generic difference algorithm for UML models. In: Liggesmeyer, P., Pohl, K., Goedicke, M. (eds.) Software Engineering 2005. Lecture Notes of Informatics, Essen, Germany, vol. P-64, pp. 105–116. Gesellschaft für Informatik (2005)

  19. Koegel, M., Hermannsdoerfer, M., von Wesendonk, O., Helming, J.: Operation-based conflict detection. In: Di Ruscio, D., Kolovos, D.S. (eds.) Proceedings of the 1st International Workshop on Model Comparison in Practice (IWMCP 2010), Malaga, Spain. ACM Press, New York, pp. 21–30 (2010)

  20. Kögel, M.: Towards software configuration management for unified models. In: Ebert, J., Kelter, U., Systä, T. (eds.) Proceedings of the 2008 International Workshop on Comparison and Versioning of Software Models (CVSM 2008), Leipzig, Germany. ACM Press, New York, pp. 19–24 (2008)

  21. Kolovos, D.S., Di Ruscio, D., Pierantonio, A., Paige, R.F.: Different models for model matching: an analysis of approaches to support model differencing. In: Proceedings of the 2nd Workshop on Comparison and Versioning of Software Models (CVSM 2009), pp. 1–6, Vancouver, BC, Canada. IEEE Computer Society Press (2009)

  22. Letkeman, K.: Comparing and Merging UML Models in IBM Rational Software Architect: Part 3. IBM (2005). Available from: http://www.ibm.com/developerworks/rational/library/05/802comp3/

  23. Lindholm, T.: A three-way merge for XML documents. In: Munson, E.V., Vion-Dury, J.-Y. (eds.) Proceedings of the ACM Symposium on Document Engineering (DocEng 2004), pp. 1–10, Milwaukee, WI. ACM Press, New York (2004)

  24. Lippe, E., van Oosterom, N.: Operation-based merging. In: Proceedings of ACM SIGSOFT ’92: Fifth Symposium on Software Development Environments (SDE5), ACM SIGSOFT Software Engineering Notes 17(5), 78–87, Tyson’s Corner, Virginia (1992)

  25. Pottinger, R., Bernstein, P.A.: Merging models based on given correspondences. In: Freytag, J.C., Lockemann, P.C., Abiteboul, S., Carey, M.J., Selinger, P.G., Heuer, A. (eds.) Proceedings of the 29th International Conference on Very Large Data Bases (VLDB 2003), pp. 826–873, Berlin, Germany. Morgan Kaufmann, San Fransisco (2003)

  26. Rönnau, S., Borghoff, U.M.: XCC: Change control of XML documents. Computer Science Research and Development 27(2), 95–111 (2012)

  27. Rossini, A., Rutle, A., Lamo, Y., Wolter, U.: A formalisation of the copy-modify-merge approach to version control in MDE. J. Logic Algebraic Program. 79(7), 636–658 (2010)

    Article  MATH  MathSciNet  Google Scholar 

  28. Rutle, A., Rossini, A., Lamo, Y., Wolter, U.: A category-theoretical approach to the formalisation of version control in MDE. In: Chechik, M., Wirsing, M. (eds.) Proceedings of the 12th International Conference on Fundamental Approaches to Software Engineering (FASE 2009). Lecture Notes in Computer Science, vol. 5503, pp. 64–78, York, UK. Springer, Berlin (2009)

  29. Steinberg, D., Budinsky, F., Paternostro, M., Merks, E.: EMF Eclipse Modeling Framework. The Eclipse Series. Addison-Wesley, Upper Saddle River (2009)

    Google Scholar 

  30. Taentzer, G., Ermel, C., Langer, P., Wimmer, M.: Conflict detection for model versioning based on graph modifications. In: Ehrig, H., Rensink, A., Rozenberg, G., Schürr, A. (eds.) ICGT 2010—Graph Transformations, 5th International Conference. Lecture Notes in Computer Science, vol. 6372, pp. 171–186. Enschede, The Netherlands (2010)

  31. van Rysselberghe, F., Demeyer, S.: Evaluating clone detection techniques from a refactoring perspective. In: Proceedings of the 19th International Conference on Automated Software Engineering (ASE 2004), pp. 336–339, Linz, Austria. IEEE Computer Society Press, New York (2004)

  32. Vesperman, J.: Essential CVS. O’Reilly, Sebastopol (2006)

    Google Scholar 

  33. Westfechtel, B.: Structure-oriented merging of revisions of software documents. In: Feiler, P.H. (ed.) Proceedings of the 3rd International Workshop on Software Configuration Management (SCM-3), pp. 68–79, Trondheim, Norway. ACM Press, New York (1991)

  34. Westfechtel, B.: A formal approach to three-way merging of EMF models. In Di Ruscio, D., Kolovos, D.S. (eds.) Proceedings of the 1st International Workshop on Model Comparison in Practice (IWMCP 2010), Malaga, Spain. ACM Press, New York, pp. 31–41 (2010)

  35. Xing, Z., Stroulia, E.: Refactoring detection based on UMLDiff change-facts queries. In: Proceedings of the 13th Working Conference on Reverse Engineering (WCRE 2006), pp. 263–274, Benevento, Italy. IEEE Computer Society Press, New York (2006)

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Bernhard Westfechtel.

Additional information

Communicated by Dr. D. Tamzalit, B. Schätz, D. Deridder and A. Pierantonio.

This paper is an extended version of [34].

Rights and permissions

Reprints and permissions

About this article

Cite this article

Westfechtel, B. Merging of EMF models. Softw Syst Model 13, 757–788 (2014). https://doi.org/10.1007/s10270-012-0279-3

Download citation

  • Received:

  • Revised:

  • Accepted:

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s10270-012-0279-3

Keywords

Navigation