Authors:
Yannis Lilis
1
;
Anthony Savidis
2
and
Yannis Valsamakis
1
Affiliations:
1
Institute of Computer Science, Greece
;
2
Institute of Computer Science and University of Crete, Greece
Keyword(s):
Model-Driven Engineering, Multistage Languages, Code Generation, Compile-Time Metaprogramming.
Related
Ontology
Subjects/Areas/Topics:
Methodologies, Processes and Platforms
;
Model Transformations and Generative Approaches
;
Model-Driven Software Development
;
Software Engineering
Abstract:
We focus on MDE tools generating source code, entire or partial, providing a basis for programmers to introduce custom system refinements and extensions. The latter may introduce two maintenance issues once code is freely edited: (i) if source tags are affected model reconstruction is broken; and (ii) code inserted without special tags is overwritten on regeneration. Additionally, little progress has been made in combining sources whose code originates from multiple generative tools. To address these issues we propose an alternative path. Instead of generating code MDE tools generate source fragments as abstract syntax trees (ASTs). Then, programmers deploy metaprogramming to manipulate, combine and insert code on-demand from ASTs with calls resembling macro invocations. The latter shifts responsibility for source code emission from MDE tools to embedded metaprograms and enables programmers control where the produced code is inserted and integrated. Moreover, it supports source regen
eration and model reconstruction causing no maintenance issues since MDE tools produce non-editable ASTs. We validate our proposition with case studies involving a user-interface builder and a general purpose modeling tool.
(More)