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.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
References
Baar, T., Whittle, J.: On the usage of concrete syntax in model transformation rules. In: Virbitskaite, I., Voronkov, A. (eds.) PSI 2006. LNCS, vol. 4378, pp. 84–97. Springer, Heidelberg (2007). https://doi.org/10.1007/978-3-540-70881-0_10
Balogh, A., Varró, D.: Advanced model transformation language constructs in the VIATRA2 framework. In: ACM Symposium on Applied Computing. ACM (2006)
Brunelière, H., Cabot, J., Dupé, G., Madiot, F.: MoDisco: a model driven reverse engineering framework. Inf. Softw. Technol. 56(8), 1012–1032 (2014)
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)
ekkes corner: Mobile & & IoT, October 2015. https://ekkescorner.wordpress.com/2009/07/16/galileo-openarchitectureware-moved-to-eclipse-modeling-projects-oaw5/
Czarnecki, K., Eisenecker, U.W.: Generative Programming: Methods, Tools, and Applications. Addison-Wesley, Boston (2000)
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.: Feature-based survey of model transformation approaches. IBM Syst. J. 45(3), 621–645 (2006)
Di Ruscio, D., Eramo, R., Pierantonio, A.: Model transformations. In: Bernardo, M., Cortellessa, V., Pierantonio, A. (eds.) SFM 2012. LNCS, vol. 7320, pp. 91–136. Springer, Heidelberg (2012). https://doi.org/10.1007/978-3-642-30982-3_4
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)
Eliens, A.: Principles of Object-Oriented Software Development. Addison-Wesley Longman Publishing Co. Inc., Boston (1994)
Gamma, E., Helm, R., Johnson, R., Vlissides, J.: Design Patterns: Elements of Reusable Object-Oriented Software. Addison-Wesley Professional, Boston (1995)
Geiger, L., Schneider, C., Reckord, C.: Template- and modelbased code generation for MDA-tools. Technical report (2005)
Génova, G., Del Castillo, C.R., Llorens, J.: Mapping UML associations into Java code. J. Object Technol. 2(5), 135–162 (2003)
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)
Girschick, M.: Integrating template-based code generation into graphical model transformation. In: Modellierung 2008, Berlin (2008)
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.: Integration of Handwritten and Generated Object-Oriented Code. In: Desfray, P., Filipe, J., Hammoudi, S., Pires, L.F. (eds.) MODELSWARD 2015. CCIS, vol. 580, pp. 112–132. Springer, Cham (2015). https://doi.org/10.1007/978-3-319-27869-8_7
Haase, A., Völter, M., Efftinge, S., Kolb, B.: Introduction to openArchitectureWare 4.1. 2. In: MDD Tool Implementers Forum at TOOLS Europe (2007). http://www.dsmforum.org/events/mdd-tif07/oAW.pdf
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)
Krahn, H., Rumpe, B., Völkel, S.: MontiCore: modular development of textual domain specific languages. In: Paige, R.F., Meyer, B. (eds.) TOOLS EUROPE 2008. LNBIP, vol. 11, pp. 297–315. Springer, Heidelberg (2008). https://doi.org/10.1007/978-3-540-69824-1_17
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)
Kundu, D., Samanta, D., Mall, R.: Automatic code generation from unified modelling language sequence diagrams. IET Softw. 7(1), 12–28 (2013)
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)
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)
Mohan, R., Kulkarni, V.: Model driven development of graphical user interfaces for enterprise business applications – experience, lessons learnt and a way forward. In: Schürr, A., Selic, B. (eds.) MODELS 2009. LNCS, vol. 5795, pp. 307–321. Springer, Heidelberg (2009). https://doi.org/10.1007/978-3-642-04425-0_23
Reiß, D.: Modellgetriebene generative Entwicklung von Web-Informationssystemen. Ph.D. thesis, RWTH Aachen University, Aachen (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)
Rumpe, B.: Modeling with UML. Springer, Cham (2016). https://doi.org/10.1007/978-3-319-33933-7
Rumpe, B., Weisemöller, I.: A domain specific transformation language. In: Workshop on Models and Evolution, vol. 11 (2011)
Rumpe, B.: Agile Modeling with UML: Code Generation, Testing, Refactoring. Springer, Cham (2017). https://doi.org/10.1007/978-3-319-58862-9
Störzer, M., Koppen, C.: PCDiff: attacking the fragile pointcut problem. In: European Interactive Workshop on Aspects in Software (2004)
Swint, G.S., et al.: Clearwater: extensible, flexible, modular code generation. In: 20th IEEE/ACM International Conference on Automated software engineering. ACM (2005)
Visser, E.: Meta-programming with concrete object syntax. In: Batory, D., Consel, C., Taha, W. (eds.) GPCE 2002. LNCS, vol. 2487, pp. 299–315. Springer, Heidelberg (2002). https://doi.org/10.1007/3-540-45821-2_19
Voelter, M., et al.: DSL Engineering - Designing, Implementing and Using Domain-Specific Languages (2013). dslbook.org
Wachsmuth, G.: A formal way from text to code templates. In: Chechik, M., Wirsing, M. (eds.) FASE 2009. LNCS, vol. 5503, pp. 109–123. Springer, Heidelberg (2009). https://doi.org/10.1007/978-3-642-00593-0_8
www: OMG UML Specification, October 2015. http://www.omg.org/spec/HrBUML/2.5/HrB
www: openarchitectureware, October 2015. https://web.archive.org/web/20140225123932/http://www.openarchitectureware.org/index.php
www: Apache maven project, August 2017. https://maven.apache.org/
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.: 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)
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2019 Springer Nature Switzerland AG
About this paper
Cite this paper
Eikermann, R., Hölldobler, K., Roth, A., Rumpe, B. (2019). Reuse and Customization for Code Generators: Synergy by Transformations and Templates. In: Hammoudi, S., Pires, L., Selic, B. (eds) Model-Driven Engineering and Software Development. MODELSWARD 2018. Communications in Computer and Information Science, vol 991. Springer, Cham. https://doi.org/10.1007/978-3-030-11030-7_3
Download citation
DOI: https://doi.org/10.1007/978-3-030-11030-7_3
Published:
Publisher Name: Springer, Cham
Print ISBN: 978-3-030-11029-1
Online ISBN: 978-3-030-11030-7
eBook Packages: Computer ScienceComputer Science (R0)