Skip to main content
Top

2019 | OriginalPaper | Chapter

Reuse and Customization for Code Generators: Synergy by Transformations and Templates

Authors : Robert Eikermann, Katrin Hölldobler, Alexander Roth, Bernhard Rumpe

Published in: Model-Driven Engineering and Software Development

Publisher: Springer International Publishing

Activate our intelligent search to find suitable subject content or patents.

search-config
loading …

Abstract

Engineering languages for model-driven development (MDD) highly rely on code generators that systematically and efficiently generate source code from abstract models. Although code generation is an essential technique, there is still a lot of ad hoc mechanisms in use that prevent an efficient and reliable use and especially reuse of code generators.
The first part of the paper focuses on general mechanisms necessary to really allow reuse of flexible code generators. Based on these general considerations, we present a code generator infrastructure, that allows to easily develop a generator, but especially allows to adapt existing generators to different technology stacks and thus widely supports reusability, customizability, and flexibility.
In the second part of the paper, we present an integrated template- and transformation-based code generation approach. It enables efficient code generation of object-oriented code and retains the benefits of both approaches. Even more, its synergetic use improves usability beyond using just a single approach. Internally, an intermediate representation (IR) and a separation of the code generation process into three main steps is used. First, the input model is processed and transformed to the IR. Second, elements in the IR are manipulated by source and target language independent transformations. Target language specific implementations are added by templates, which are attached to IR elements. Third, the resulting IR is used by a template engine to generate code with a predefined set of default templates for a particular target language. The overall goal of this paper is to show how to address necessary code generator considerations to effectively and efficiently use engineering languages in MDD.

Dont have a licence yet? Then find out more about our products and how to get one now:

Springer Professional "Wirtschaft+Technik"

Online-Abonnement

Mit Springer Professional "Wirtschaft+Technik" erhalten Sie Zugriff auf:

  • über 102.000 Bücher
  • über 537 Zeitschriften

aus folgenden Fachgebieten:

  • Automobil + Motoren
  • Bauwesen + Immobilien
  • Business IT + Informatik
  • Elektrotechnik + Elektronik
  • Energie + Nachhaltigkeit
  • Finance + Banking
  • Management + Führung
  • Marketing + Vertrieb
  • Maschinenbau + Werkstoffe
  • Versicherung + Risiko

Jetzt Wissensvorsprung sichern!

Springer Professional "Technik"

Online-Abonnement

Mit Springer Professional "Technik" erhalten Sie Zugriff auf:

  • über 67.000 Bücher
  • über 390 Zeitschriften

aus folgenden Fachgebieten:

  • Automobil + Motoren
  • Bauwesen + Immobilien
  • Business IT + Informatik
  • Elektrotechnik + Elektronik
  • Energie + Nachhaltigkeit
  • Maschinenbau + Werkstoffe




 

Jetzt Wissensvorsprung sichern!

Springer Professional "Wirtschaft"

Online-Abonnement

Mit Springer Professional "Wirtschaft" erhalten Sie Zugriff auf:

  • über 67.000 Bücher
  • über 340 Zeitschriften

aus folgenden Fachgebieten:

  • Bauwesen + Immobilien
  • Business IT + Informatik
  • Finance + Banking
  • Management + Führung
  • Marketing + Vertrieb
  • Versicherung + Risiko




Jetzt Wissensvorsprung sichern!

Literature
2.
go back to reference Balogh, A., Varró, D.: Advanced model transformation language constructs in the VIATRA2 framework. In: ACM Symposium on Applied Computing. ACM (2006) Balogh, A., Varró, D.: Advanced model transformation language constructs in the VIATRA2 framework. In: ACM Symposium on Applied Computing. ACM (2006)
3.
go back to reference Brunelière, H., Cabot, J., Dupé, G., Madiot, F.: MoDisco: a model driven reverse engineering framework. Inf. Softw. Technol. 56(8), 1012–1032 (2014)CrossRef Brunelière, H., Cabot, J., Dupé, G., Madiot, F.: MoDisco: a model driven reverse engineering framework. Inf. Softw. Technol. 56(8), 1012–1032 (2014)CrossRef
4.
go back to reference Chared, Z., Tyszberowicz, S.S.: Projective template-based code generation. In: CAiSE 2013 Forum at the 25th International Conference on Advanced Information Systems Engineering, vol. 998. CEURS-WS.org (2013) Chared, Z., Tyszberowicz, S.S.: Projective template-based code generation. In: CAiSE 2013 Forum at the 25th International Conference on Advanced Information Systems Engineering, vol. 998. CEURS-WS.org (2013)
6.
go back to reference Czarnecki, K., Eisenecker, U.W.: Generative Programming: Methods, Tools, and Applications. Addison-Wesley, Boston (2000) Czarnecki, K., Eisenecker, U.W.: Generative Programming: Methods, Tools, and Applications. Addison-Wesley, Boston (2000)
7.
go back to reference Czarnecki, K., Helsen, S.: Classification of model transformation approaches. In: 2nd OOPSLA 2003 Workshop on Generative Techniques in the Context of MDA (2003) Czarnecki, K., Helsen, S.: Classification of model transformation approaches. In: 2nd OOPSLA 2003 Workshop on Generative Techniques in the Context of MDA (2003)
8.
go back to reference Czarnecki, K., Helsen, S.: Feature-based survey of model transformation approaches. IBM Syst. J. 45(3), 621–645 (2006)CrossRef Czarnecki, K., Helsen, S.: Feature-based survey of model transformation approaches. IBM Syst. J. 45(3), 621–645 (2006)CrossRef
10.
go back to reference El Beggar, O., Bousetta, B., Gadi, T.: Automatic code generation by model transformation from sequence diagram of system’s internal behavior. Int. J. Comput. Inf. Technol. 1(02), 129–146 (2012) El Beggar, O., Bousetta, B., Gadi, T.: Automatic code generation by model transformation from sequence diagram of system’s internal behavior. Int. J. Comput. Inf. Technol. 1(02), 129–146 (2012)
11.
go back to reference Eliens, A.: Principles of Object-Oriented Software Development. Addison-Wesley Longman Publishing Co. Inc., Boston (1994)MATH Eliens, A.: Principles of Object-Oriented Software Development. Addison-Wesley Longman Publishing Co. Inc., Boston (1994)MATH
12.
go back to reference Gamma, E., Helm, R., Johnson, R., Vlissides, J.: Design Patterns: Elements of Reusable Object-Oriented Software. Addison-Wesley Professional, Boston (1995)MATH Gamma, E., Helm, R., Johnson, R., Vlissides, J.: Design Patterns: Elements of Reusable Object-Oriented Software. Addison-Wesley Professional, Boston (1995)MATH
13.
go back to reference Geiger, L., Schneider, C., Reckord, C.: Template- and modelbased code generation for MDA-tools. Technical report (2005) Geiger, L., Schneider, C., Reckord, C.: Template- and modelbased code generation for MDA-tools. Technical report (2005)
14.
go back to reference Génova, G., Del Castillo, C.R., Llorens, J.: Mapping UML associations into Java code. J. Object Technol. 2(5), 135–162 (2003)CrossRef Génova, G., Del Castillo, C.R., Llorens, J.: Mapping UML associations into Java code. J. Object Technol. 2(5), 135–162 (2003)CrossRef
15.
go back to reference Gessenharter, D.: Implementing UML associations in Java: a slim code pattern for a complex modeling concept. In: Workshop on Relationships and Associations in Object-Oriented Languages (RAOOL 2009). ACM (2009) Gessenharter, D.: Implementing UML associations in Java: a slim code pattern for a complex modeling concept. In: Workshop on Relationships and Associations in Object-Oriented Languages (RAOOL 2009). ACM (2009)
16.
go back to reference Girschick, M.: Integrating template-based code generation into graphical model transformation. In: Modellierung 2008, Berlin (2008) Girschick, M.: Integrating template-based code generation into graphical model transformation. In: Modellierung 2008, Berlin (2008)
17.
go back to reference Greifenberg, T., et al.: A comparison of mechanisms for integrating handwritten and generated code for object-oriented programming languages. CoRR abs/1509.04498 (2015) Greifenberg, T., et al.: A comparison of mechanisms for integrating handwritten and generated code for object-oriented programming languages. CoRR abs/1509.04498 (2015)
20.
go back to reference Hemel, Z., Kats, L.C.L., Groenewegen, D.M., Visser, E.: Code generation by model transformation: a case study in transformation modularity. Softw. Syst. Model. 9(3), 375–402 (2010)CrossRef Hemel, Z., Kats, L.C.L., Groenewegen, D.M., Visser, E.: Code generation by model transformation: a case study in transformation modularity. Softw. Syst. Model. 9(3), 375–402 (2010)CrossRef
22.
go back to reference Krahn, H., Rumpe, B., Völkel, S.: MontiCore: a framework for compositional development of domain specific languages. Int. J. Softw. Tools Technol. Transfer (STTT) 12, 353–372 (2010)CrossRef Krahn, H., Rumpe, B., Völkel, S.: MontiCore: a framework for compositional development of domain specific languages. Int. J. Softw. Tools Technol. Transfer (STTT) 12, 353–372 (2010)CrossRef
23.
go back to reference Kundu, D., Samanta, D., Mall, R.: Automatic code generation from unified modelling language sequence diagrams. IET Softw. 7(1), 12–28 (2013)CrossRef Kundu, D., Samanta, D., Mall, R.: Automatic code generation from unified modelling language sequence diagrams. IET Softw. 7(1), 12–28 (2013)CrossRef
24.
go back to reference Mens, T., Czarnecki, K., Gorp, P.V.: A taxonomy of model transformations. In: Language Engineering for Model-Driven Software Development. Dagstuhl Seminar Proceedings. Internationales Begegnungs- und Forschungszentrum (IBFI) (2005) Mens, T., Czarnecki, K., Gorp, P.V.: A taxonomy of model transformations. In: Language Engineering for Model-Driven Software Development. Dagstuhl Seminar Proceedings. Internationales Begegnungs- und Forschungszentrum (IBFI) (2005)
25.
go back to reference Mir Seyed Nazari, P., Roth, A., Rumpe, B.: Mixed generative and handcoded development of adaptable data-centric business applications. In: Proceedings of the Workshop on Domain-Specific Modeling. ACM (2015) Mir Seyed Nazari, P., Roth, A., Rumpe, B.: Mixed generative and handcoded development of adaptable data-centric business applications. In: Proceedings of the Workshop on Domain-Specific Modeling. ACM (2015)
27.
go back to reference Reiß, D.: Modellgetriebene generative Entwicklung von Web-Informationssystemen. Ph.D. thesis, RWTH Aachen University, Aachen (2015) Reiß, D.: Modellgetriebene generative Entwicklung von Web-Informationssystemen. Ph.D. thesis, RWTH Aachen University, Aachen (2015)
28.
go back to reference Roth, A., Rumpe, B.: Towards product lining model-driven development code generators. In: 3rd International Conference on Model-Driven Engineering and Software Development. Springer, Cham (2015) Roth, A., Rumpe, B.: Towards product lining model-driven development code generators. In: 3rd International Conference on Model-Driven Engineering and Software Development. Springer, Cham (2015)
30.
go back to reference Rumpe, B., Weisemöller, I.: A domain specific transformation language. In: Workshop on Models and Evolution, vol. 11 (2011) Rumpe, B., Weisemöller, I.: A domain specific transformation language. In: Workshop on Models and Evolution, vol. 11 (2011)
32.
go back to reference Störzer, M., Koppen, C.: PCDiff: attacking the fragile pointcut problem. In: European Interactive Workshop on Aspects in Software (2004) Störzer, M., Koppen, C.: PCDiff: attacking the fragile pointcut problem. In: European Interactive Workshop on Aspects in Software (2004)
33.
go back to reference Swint, G.S., et al.: Clearwater: extensible, flexible, modular code generation. In: 20th IEEE/ACM International Conference on Automated software engineering. ACM (2005) Swint, G.S., et al.: Clearwater: extensible, flexible, modular code generation. In: 20th IEEE/ACM International Conference on Automated software engineering. ACM (2005)
35.
go back to reference Voelter, M., et al.: DSL Engineering - Designing, Implementing and Using Domain-Specific Languages (2013). dslbook.org Voelter, M., et al.: DSL Engineering - Designing, Implementing and Using Domain-Specific Languages (2013). dslbook.​org
40.
go back to reference Zschaler, S., Rashid, A.: Symmetric language-aware aspects for modular code generators. Technical Report TR-11-01, King’s College, Department of Informatics (2011) Zschaler, S., Rashid, A.: Symmetric language-aware aspects for modular code generators. Technical Report TR-11-01, King’s College, Department of Informatics (2011)
41.
go back to reference Zschaler, S., Rashid, A.: Towards modular code generators using symmetric language-aware aspects. In: Proceedings of the 1st International Workshop on Free Composition. FREECO 2011, pp. 6:1–6:5. ACM, New York (2011) Zschaler, S., Rashid, A.: Towards modular code generators using symmetric language-aware aspects. In: Proceedings of the 1st International Workshop on Free Composition. FREECO 2011, pp. 6:1–6:5. ACM, New York (2011)
Metadata
Title
Reuse and Customization for Code Generators: Synergy by Transformations and Templates
Authors
Robert Eikermann
Katrin Hölldobler
Alexander Roth
Bernhard Rumpe
Copyright Year
2019
DOI
https://doi.org/10.1007/978-3-030-11030-7_3

Premium Partner