Staged Model-Driven Generators - Shifting Responsibility for Code Emission to Embedded Metaprograms
Yannis Lilis, Anthony Savidis, Yannis Valsamakis
2014
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 regeneration 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.
References
- Actifsource GmbH (2010). Actifsource Code Generator for Eclipse. http://www.actifsource.com/_downloads/ actifsource_code_generator_for_Eclipse_en.pdf Accessed 29 Oct 2013.
- Antkiewicz, M. 2007. Round-trip engineering using framework-specific modeling languages. In Companion to the 22nd ACM SIGPLAN conference on Object-oriented programming systems and applications companion (OOPSLA'07).ACM,927-928. DOI= http://doi.acm.org/10.1145/1297846.1297949.
- Badreddin, O. and Lethbridge, T.C. 2013. Model Oriented Programming: Bridging the Code-Model Divide. In Proceedings of the 5th International Workshop on Modeling in Software Engineering, IEEE, pp. 69-75, DOI=http://dx.doi.org/10.1109/MiSE.2013.6595299.
- Bettini, L. 2013. Implementing Domain-Specific Languages with Xtext and Xtend. Packt Publishing.
- Calcagno, C., Taha, W., Huang, L. and Leroy, X. 2001. A bytecode-compiled, type-safe, multi-stage language.
- Chalabine, M. and Kessler, C. 2007. A Formal Framework for Automated Round-Trip Software Engineering in Static Aspect Weaving and Transformations. In Proceedings of the 29th international conference on Software Engineering (ICSE 7807). IEEE, 137-146. DOI= http://dx.doi.org/10.1109/ICSE.2007.7.
- Desfray, P. 2009. Modelio: Globalizing MDA. In Proc. of the Tools and Consultancy Track of the Fifth European Conference on Model-Driven Architecture Foundations and Applications (ECMDA-FA 2009).
- Dybvig, R. K. 2009. The Scheme Programming Language (fourth edition). The MIT Press.
- Eclipse Foundation. 2008. Eclipse Modeling Framework (EMF). http://www.eclipse.org/modeling/emf/ Accessed 29 Oct 2013.
- Fleutot, F. 2007. Metalua Manual. http://metalua.luaforge. net/metalua-manual.html. Accessed 29 Oct 2013.
- Hemel, Z., Kats, L. C. L., Groenewegen, D. M. and Visser, E. 2010. Code generation by model transformation: a case study in transformation modularity. Software and Systems Modelling, 9(3):375-402. DOI=http://dx.doi.org/10.1007/s10270- 009-0136-1.
- Lanusse, A., Tanguy, Y., Espinoza, H., Mraidha, C., Gerard, S., Tessier, P., Schnekenburger, R., Dubois, H. and Terrier, F. 2009. Papyrus UML: an open source toolset for MDA. In Proceedings of the Tools and Consultancy Track of the Fifth European Conference on Model-Driven Architecture Foundations and Applications (ECMDA-FA 2009).
- Lilis, Y. and Savidis, A. 2012. Supporting Compile-Time Debugging and Precise Error Reporting in MetaPrograms. In TOOLS 2012, International Conference on Technology of Object Oriented Languages and Systems, Springer LNCS 7304, pp. 155-170. DOI= http://dx.doi.org/10.1007/978-3-642-30561-0_12.
- Michotte, B. and Vanderdonckt, J. 2008. GrafiXML, a Multi-target User Interface Builder Based on UsiXML. In Proceedings of ICAS 2008 4th International Conference on Autonomic and Autonomous Systems, Gosier, Guadeloupe, IEEE, 15- 22. DOI= http://dx.doi.org/10.1109/ICAS.2008.29.
- Neverov, G. and Roe, P. 2004. Metaphor: A Multi-Stage, Object-Oriented Programming Language. In Proceedings of the Third International Conference on Generative Programming and Component Engineering (GPCE 7804), Vancouver, Canada, Springer LNCS 3286, pp. 168-185, DOI=http://dx.doi.org/ 10.1007/978-3-540-30175-2_9.
- Obeo. 2006. Acceleo: MDA generator. http://www. acceleo.org/pages/home/en. Accessed 29 Oct 2013.
- OMG. 2012. Object Management Group Object Constraint Language (OCL). http://www.omg.org/spec/OCL/ ISO/19507/PDF/ Accessed 29 Oct 2013.
- Sauer, S. and Engels, G. 2007. Easy model-driven development of multimedia user interfaces with GuiBuilder. In Proceedings of the 4th international conference on Universal Access in Human Computer Interaction (UAHCI'07), Beijing, China, Springer LNCS 4554, pp. 537-546, DOI= http://dx.doi.org/ 10.1007/978-3-540-73279-2_60.
- Savidis, A. 2012. Delta Programming Language. Available online from: http://www.ics.forth.gr/hci/ files/plang/Delta/Delta.html. Accessed 29 Oct 2013.
- Sheard, T. 1999. Using MetaML: A Staged Programming Language. In: Advanced Functional Programming. Springer LNCS 1608, pp. 207-239, DOI=http:// dx.doi.org/10.1007/10704973_5.
- Sheard, T., Benaissa, Z. and Martel, M. 2000. Introduction to Multistage Programming Using MetaML. Pacific Software Research Center, Oregon Graduate Institute, 2nd edition. Available from: http://web.cecs.pdx.edu/ sheard/papers/manual.ps. Accessed 29 Oct 2013.
- Sheard, T. and Peyton Jones, S. 2002. Template metaprogramming for Haskell. SIGPLAN Not. 37, 12, 60-75, DOI=http://dx.doi.org/10.1145/636517.636528.
- Staiger, S. 2007. Static Analysis of Programs with Graphical User Interface. In Proceedings of 11th European Conference on Software Maintenance and Reengineering (CSMR 7807). IEEE, pp. 252-264, DOI=http://dx.doi.org/10.1109/CSMR.2007.44.
- Steele, G. L. 1990. Common Lisp: The Language. Digital Press, second edition.
- Taha, W. 2004. A gentle introduction to multi-stage programming. In Proceedings of Domain-Specific Program Generation, Springer LNCS 3016, pp. 30-50. DOI=http://dx.doi.org/10.1007/978-3-540-25935-0_3.
- Tratt, L. 2005. Compile-time meta-programming in a dynamically typed OO language. In Proceedings of the 2005 Symposium on Dynamic Languages (DLS 7805). ACM, New York, USA, pp. 49-63, DOI=http:// doi.acm.org/10.1145/1146841.1146846.
- Vlissides, J. 1996. Generation Gap [software design pattern]. C++ Report, 8(10), pp. 12, 14-18.
- Völter, M. and Groher, I. 2007. Handling variability in model transformations and generators. In Proceedings of the 7th OOPSLA Workshop on Domain-Specific Modeling (DSM 7807). Available online from: http://www.voelter.de/data/workshops/HandlingVaria bilityInModelTransformations.pdf.
- Westbrook, E., Ricken, M., Inoue, J., Yao, Y., Abdelatif, T. and Taha, W. 2010. Mint: Java multi-stage programming using weak separability. In Proceedings of the 2010 ACM SIGPLAN conference on Programming language design and implementation. PLDI 7810 ACM, New York, 400-411. DOI=http://doi.acm.org/10.1145/1806596.1806642.
- wxFormBuilder. 2006. wxFormBuilder - A RAD tool for wx GUI design. http://sourceforge.net/projects/ wxformbuilder/ Accessed 29 Oct 2013.
- Zschaler, S. and Rashid, A. 2011. Towards modular code generators using symmetric language-aware aspects. In Proceedings of the 1st International Workshop on Free Composition (FREECO 7811). ACM, New York, NY, USA, Article 6, 5 pages. DOI=http:// doi.acm.org/10.1145/2068776.2068782.
Paper Citation
in Harvard Style
Lilis Y., Savidis A. and Valsamakis Y. (2014). Staged Model-Driven Generators - Shifting Responsibility for Code Emission to Embedded Metaprograms . In Proceedings of the 2nd International Conference on Model-Driven Engineering and Software Development - Volume 1: MODELSWARD, ISBN 978-989-758-007-9, pages 509-521. DOI: 10.5220/0004878605090521
in Bibtex Style
@conference{modelsward14,
author={Yannis Lilis and Anthony Savidis and Yannis Valsamakis},
title={Staged Model-Driven Generators - Shifting Responsibility for Code Emission to Embedded Metaprograms},
booktitle={Proceedings of the 2nd International Conference on Model-Driven Engineering and Software Development - Volume 1: MODELSWARD,},
year={2014},
pages={509-521},
publisher={SciTePress},
organization={INSTICC},
doi={10.5220/0004878605090521},
isbn={978-989-758-007-9},
}
in EndNote Style
TY - CONF
JO - Proceedings of the 2nd International Conference on Model-Driven Engineering and Software Development - Volume 1: MODELSWARD,
TI - Staged Model-Driven Generators - Shifting Responsibility for Code Emission to Embedded Metaprograms
SN - 978-989-758-007-9
AU - Lilis Y.
AU - Savidis A.
AU - Valsamakis Y.
PY - 2014
SP - 509
EP - 521
DO - 10.5220/0004878605090521