Advertisement

Software & Systems Modeling

, Volume 12, Issue 3, pp 579–596 | Cite as

On the reuse and recommendation of model refactoring specifications

  • Jan Reimann
  • Mirko Seifert
  • Uwe Aßmann
Special Section Paper

Abstract

Refactorings can be used to improve the structure of software artefacts while preserving the semantics of the encapsulated information. Various types of refactorings have been proposed and implemented for programming languages (e.g., Java or C#). With the advent of (MDSD), a wealth of modelling languages rises and the need for restructuring models similar to programs has emerged. Since parts of these modelling languages are often very similar, we consider it beneficial to reuse the core transformation steps of refactorings across languages. In this sense, reusing the abstract transformation steps and the abstract participating elements suggests itself. Previous work in this field indicates that refactorings can be specified generically to foster their reuse. However, existing approaches can handle certain types of modelling languages only and solely reuse refactorings once per language. In this paper, a novel approach based on role models to specify generic refactorings is presented. Role models are suitable for this problem since they support declaration of roles which have to be played in a certain context. Assigned to generic refactoring, contexts are different refactorings and roles are the participating elements. We discuss how this resolves the limitations of previous works, as well as how specific refactorings can be defined as extensions to generic ones. The approach was implemented in our tool Refactory based on the (EMF) and evaluated using multiple modelling languages and refactorings. In addition, this paper investigates on the recommendation of refactoring specifications. This is motivated by the fact that language designers have many possibilities to enable refactorings in their modelling languages with regard to the language structures. To overcome this problem and to support language designers in deciding which refactorings to enable, we propose a solution and a prototypical implementation.

Keywords

Generic model refactoring Role-based refactoring Refactoring reuse Refactoring recommendation Role modelling 

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. 1.
    Lehman M.M.: On understanding laws, evolution, and conservation in the large-program life cycle. J. Syst. Softw. 1, 213–221 (1980)CrossRefGoogle Scholar
  2. 2.
    Opdyke, W.F.: Refactoring object-oriented frameworks. PhD thesis, University of Illinois at Urbana-Champaign (1992)Google Scholar
  3. 3.
    Fowler M.: Refactoring: Improving the Design of Existing Code. Addison-Wesley Longman, Amsterdam (1999)Google Scholar
  4. 4.
    Kurtev, I., Bézivin, J., Aksit, M.: Technological Spaces: An initial appraisal. In: International Symposium on Distributed Objects and Applications, DOA Federated Conferences, Industrial track, Irvine, 2002 (2002)Google Scholar
  5. 5.
    Kleppe A.: Software Language Engineering. Pearson Education, India (2009)Google Scholar
  6. 6.
    Klein, G.: JFlex User’s Manual, Version 1.4.3. http://jflex.de/manual.html#SECTION00040000000000000000 (January 2009)
  7. 7.
    Kats, L.C.L., Visser, E.: The Spoofax Language Workbench: Rules for Declarative Specification of Languages and IDEs. In: Cook, W.R., Clarke, S., Rinard, M.C., (eds.) Proceedings of the 25th Annual ACM SIGPLAN Conference on Object-Oriented Programming, Systems, Languages, and Applications, OOPSLA 2010, Reno/Tahoe, Nevada, ACM (2010), pp. 444–463Google Scholar
  8. 8.
    Mens, T., Taentzer, G., Müller, D.: Challenges in model refactoring. In: Proceedings of 1st Workshop on Refactoring Tools, University of Berlin (2007)Google Scholar
  9. 9.
    Object Management Group: OMG Unified Modeling Language TM (OMG UML), Superstructure, Version 2.3. http://www.omg.org/spec/UML/2.3/Superstructure/PDF/ (2010)
  10. 10.
    Steinberg D., Budinsky F., Paternostro M., Merks E.: Eclipse Modeling Framework, 2nd edn. Pearson Education, (2008)Google Scholar
  11. 11.
    Reimann J., Seifert M., Aßmann U.: Role-based generic model refactoring. In: Petriu, D.C., Rouquette, N., Haugen, Ø. (eds) MoDELS (2). Lecture Notes in Computer Science, vol. 6395, pp. 78–92. Springer, Berlin (2010)Google Scholar
  12. 12.
    The Object Management Group: Meta Object Facility (MOF) Core Specification. Technical report (January 2006)Google Scholar
  13. 13.
    Moha N., Mahé V., Barais O., Jézéquel J.M.: Generic model refactorings. In: Schürr, A., Selic, B. (eds) MODELS. Lecture Notes in Computer Science, vol. 5795, pp. 628–643. Springer, Berlin (2009)Google Scholar
  14. 14.
    Zhang J., Lin Y., Gray J.: Generic and domain-specific model refactoring using a model transformation engine. In: Beydeda, S., Book, M., Gruhn, V. (eds) Research and Practice in Software Eng, vol. II, pp. 199–218. Springer, Berlin (2005)Google Scholar
  15. 15.
    Lämmel, R.: Towards generic refactoring. In: Proceedings of Third ACM SIGPLAN Workshop on Rule-Based Programming RULE’02, Pittsburgh, USA, ACM Press, October 2002Google Scholar
  16. 16.
    Taentzer, G., Müller, D., Mens, T.: Specifying domain-specific refactorings for AndroMDA based on graph transformation. In: Applications of Graph Transformations with Industrial Relevance: Third International Symposium, AGTIVE 2007, Kassel, Germany, October 10–12, 2007, Revised Selected and Invited Papers. Springer, Berlin, pp. 104–119 (2008)Google Scholar
  17. 17.
    Biermann, E., Ehrig, K., Köhler, C., Kuhns, G., Taentzer, G., Weiss, E.: In: Graphical Definition of In-Place Transformations in the Eclipse Modeling Framework. Lecture Notes in Computer Science, vol. 4199/2006, pp. 425–439. Springer, Berlin (2006)Google Scholar
  18. 18.
    Brosch P., Seidl M., Wieland K., Wimmer M., Langer P.: The operation recorder: specifying model refactorings by-example. In: Arora, S., Leavens, G.T. (eds) OOPSLA companion, pp. 791–792. ACM, New York (2009)Google Scholar
  19. 19.
    Brosch, P., Langer, P., Seidl, M., Wieland, K., Wimmer, M., Kappel, G., Retschitzegger, W., Schwinger, W.: An example is worth a thousand words: composite operation modeling by-example. In: MODELS ’09: Proceedings of the 12th International Conf. on Model Driven Engineering Languages and Systems. Springer, Berlin, pp. 271–285 (2009)Google Scholar
  20. 20.
    Sun Y., White J., Gray J.: Model transformation by demonstration. In: Schürr, A., Selic, B. (eds) Model Driven Engineering Languages and Systems. Lecture Notes in Computer Science, vol. 5795, pp. 712–726. Springer, Berlin (2009)CrossRefGoogle Scholar
  21. 21.
    Riehle, D., Gross, T.: Role Model Based Framework Design and Integration. In: Proceedings of OOPSLA’98, New York, NY, USA, ACM (1998) 117–133Google Scholar
  22. 22.
    Reenskaug, T., Wold, P., Lehne, O.A.: Working with objects—The OOram Software Engineering Method. http://heim.ifi.uio.no/~trygver/1996/book/WorkingWithObjects (1996)
  23. 23.
    The Object Management Group: Meta Object Facility (MOF) 2.0 Query/View/Transformation. Specification Version 1.0 (April 2008)Google Scholar
  24. 24.
    Czarnecki K., Helsen S.: Feature-based survey of model transformation approaches. IBM Syst. J. 45(3), 621–645 (2006)CrossRefGoogle Scholar
  25. 25.
    Ekman T., Hedin G.: The JastAdd Extensible Java Compiler. SIGPLAN Not. 42(10), 1–18 (2007)CrossRefGoogle Scholar
  26. 26.
    Bürger C., Karol S., Wende C., Aßmann U.: Reference attribute grammars for metamodel semantics. In: Malloy, B., Staab, S., Brand, M. (eds) Software Language Engineering. Lecture Notes in Computer Science, vol. 6563, pp. 22–41. Springer, Berlin (2011)Google Scholar
  27. 27.
    Åkesson J., Ekman T., Hedin G.: Development of a Modelica compiler using JastAdd. Electron. Notes Theor. Comput. Sci. 203(2), 117–131 (2008)CrossRefGoogle Scholar
  28. 28.
    Samlaus, R., Hillmann, C., Demuth, B., Krebs, M.: Towards a model driven Modelica IDE. In: 8th International Modelica Conference, Dresden (2011)Google Scholar
  29. 29.
    Heidenreich, F., Johannes, J., Seifert, M., Thiele, M., Wende, C., Wilke, C.: Integrating OCL and Textual Modelling Languages. In: Proceedings of Workshop on OCL and Textual Modelling (OCL2010), October 2010Google Scholar
  30. 30.
    Heidenreich, F., Johannes, J., Karol, S., Seifert, M., Wende, C.: Derivation and Refinement of Textual Syntax for Models. In: Proceedings of the 5th Europ. Conf. on Model Driven Architecture—Foundations and Applications (ECMDA-FA 2009). LNCS, vol. 5562, pp. 114–129. Springer, Berlin (2009)Google Scholar
  31. 31.
    Gronback, R.C.: Eclipse Modeling Project: A Domain-Specific Language (DSL) Toolkit. Pearson Education, India (2009)Google Scholar
  32. 32.
    W3C: OWL 2 Web Ontology Language: Structural Specification and Functional-Style Syntax. Technical report (2009)Google Scholar
  33. 33.
    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: International Workshop on Comparison and Versioning of Software Models, MCVS’09 at ICSE’09, IEEE Computer Society (2009)Google Scholar
  34. 34.
    Lin Y., Gray J., Jouault F.: DSMDiff: a differentiation tool for domain-specific models. Eur. J. Inf. Syst. 16, 349–361 (2007)CrossRefGoogle Scholar
  35. 35.
    Euzenat J., Shvaiko P.: Ontology Matching. Springer, Heidelberg (2007)MATHGoogle Scholar
  36. 36.
    Wachsmuth G.: Metamodel adaptation and model co-adaptation. In: Ernst, E. (eds) ECOOP. Lecture Notes in Computer Science, vol. 4609, pp. 600–624. Springer, Berlin (2007)Google Scholar
  37. 37.
    Vermolen, S.: Software Language Evolution. In: Hassan, A.E., Zaidman, A., Penta, M.D. (eds.) WCRE, IEEE, pp. 323–326 (2008)Google Scholar
  38. 38.
    Rose L.M., Herrmannsdörfer M., Williams J.R., Kolovos D.S., Garcés K., Paige R.F., Polack F.A.C.: A Comparison of Model Migration Tools. In: Petriu, D.C., Rouquette, N., Haugen, Ø. (eds) MoDELS (1). Lecture Notes in Computer Science, vol. 6394, pp. 61–75. Springer, Berlin (2010)Google Scholar
  39. 39.
    Herrmannsdörfer M.: COPE—a workbench for the coupled evolution of metamodels and models. In: Malloy, B.A., Staab, S., van den Brand, M. (eds) SLE. Lecture Notes in Computer Science, vol. 6563, pp. 286–295. Springer, Berlin (2010)Google Scholar
  40. 40.
    Lee, E.A.: Cyber physical systems: design challenges. Technical Report UCB/EECS-2008-8, University of California at Berkeley, Electrical Engineering and Computer Sciences (January 2008)Google Scholar

Copyright information

© Springer-Verlag 2012

Authors and Affiliations

  1. 1.Technische Universität Dresden, Institut für Software- und MultimediatechnikDresdenGermany
  2. 2.DevBoost GmbHBerlinGermany

Personalised recommendations