Code Generation by Model Transformation

A Case Study in Transformation Modularity
  • Zef Hemel
  • Lennart C. L. Kats
  • Eelco Visser
Part of the Lecture Notes in Computer Science book series (LNCS, volume 5063)


The realization of model-driven software development requires effective techniques for implementing code generators. In this paper, we present a case study of code generation by model transformation with Stratego, a high-level transformation language based on the paradigm of rewrite rules with programmable strategies that integrates model-to-model, model-to-code, and code-to-code transformations. The use of concrete object syntax guarantees syntactic correctness of code patterns, and enables the subsequent transformation of generated code. The composability of strategies supports two dimensions of transformation modularity. Vertical modularity is achieved by designing a generator as a pipeline of model-to-model transformations that gradually transforms a high-level input model to an implementation. Horizontal modularity is achieved by supporting the definition of plugins which implement all aspects of a language feature. We discuss the application of these techniques in the implementation of WebDSL, a domain-specific language for dynamic web applications with a rich data model.


Model Transformation Target Language Abstract Syntax Object Management Group Transformation Modularity 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 1.
    Kraus, A.K.A., Koch, N.: Model-driven generation of web applications in UWE. In: Model-Driven Web Engineering (MDWE 2007), Como, Italy (July 2007)Google Scholar
  2. 2. AndroMDA documentation (2007),
  3. 3.
    Bézivin, J.: On the unification power of models. Software and System Modeling 4(2), 171–188 (2005)CrossRefGoogle Scholar
  4. 4.
    Bézivin, J.: Model Driven Engineering: An Emerging Technical Space. In: Lämmel, R., Saraiva, J., Visser, J. (eds.) GTTSE 2005. LNCS, vol. 4143, pp. 36–64. Springer, Heidelberg (2006)CrossRefGoogle Scholar
  5. 5.
    Bravenboer, M., Kalleberg, K.T., Vermaas, R., Visser, E.: Stratego/XT 0.16. Components for transformation systems. In: Partial Evaluation and Program Manipulation (PEPM 2006), Charleston, South Carolina. ACM, New York (2006)Google Scholar
  6. 6.
    Bravenboer, M., van Dam, A., Olmos, K., Visser, E.: Program transformation with scoped dynamic rewrite rules. Fund. Informaticae 69(1–2), 123–178 (2006)zbMATHGoogle Scholar
  7. 7.
    Czarnecki, K., Helsen, S.: Feature-based survey of model transformation approaches. IBM Systems Journal 45(3), 621–645 (2006)CrossRefGoogle Scholar
  8. 8.
    Efftinge, S., Friese, P.: openArchitectureWare (2007),
  9. 9.
    Jouault, F., Bézivin, J.: KM3: a DSL for metamodel specification. In: Gorrieri, R., Wehrheim, H. (eds.) FMOODS 2006. LNCS, vol. 4037, pp. 171–185. Springer, Heidelberg (2006)CrossRefGoogle Scholar
  10. 10.
    Jouault, F., Bézivin, J., Kurtev, I.: TCS: a DSL for the specification of textual concrete syntaxes in model engineering. In: Generative programming and component engineering (GPCE 2006), pp. 249–254. ACM Press, New York (2006)CrossRefGoogle Scholar
  11. 11.
    Jouault, F., Kurtev, I.: Transforming Models with ATL. In: Bruel, J.-M. (ed.) MoDELS 2005. LNCS, vol. 3844, pp. 128–138. Springer, Heidelberg (2006)CrossRefGoogle Scholar
  12. 12.
    Kurtev, I., Bézivin, J., Jouault, F., Valduriez, P.: Model-based DSL frameworks. In: Companion to OOPSLA 2006, pp. 602–616. ACM Press, New York (2006)CrossRefGoogle Scholar
  13. 13.
    Brambilla, P.F.M., Comai, S., Matera, M.: Designing web applications with WebML and WebRatio. In: Rossi, G., et al. (eds.) Web Engineering: Modelling and Implementing Web Applications. Human-Computer Interaction Series. Springer, Heidelberg (2007)Google Scholar
  14. 14.
    Mens, T., van Gorp, P.: A taxonomy of model transformation. In: Graph and Model Transformation (GraMoT 2005), vol. 152, pp. 125–142 (March 2006)Google Scholar
  15. 15.
    Pastor, V.P.O., Fons, J.: OOWS: A method to develop web applications from web-oriented conceptual models. In: Web Oriented Software Technology (IWWOST 2003), pp. 65–70 (2003)Google Scholar
  16. 16.
    Object Management Group (OMG). Meta object facility (MOF) core specification. OMG available specification. Version 2.0 (January 2006),
  17. 17.
    Cáceres, B.V.P., Marcos, E.: A MDA-Based approach for web information system development. In: Proceedings of Workshop in Software Model Engineering (2003)Google Scholar
  18. 18.
    Pierre-Alain Muller, F.F., Studer, P., Bézivin, J.: Platform independent web application modeling and development with Netsilon. Software and Systems Modeling 4(4), 424–442 (2005)CrossRefGoogle Scholar
  19. 19.
    The Apache Foundation. Velocity User Guide (2007),
  20. 20.
    van Deursen, A., Klint, P., Tip, F.: Origin tracking. Journal of Symbolic Computation 15(5/6), 523–545 (1993)zbMATHGoogle Scholar
  21. 21.
    Visser, E.: Syntax Definition for Language Prototyping. PhD thesis, University of Amsterdam (September 1997)Google Scholar
  22. 22.
    Visser, E.: Meta-programming with Concrete Object Syntax. In: Batory, D., Consel, C., Taha, W. (eds.) GPCE 2002. LNCS, vol. 2487, Springer, Heidelberg (2002)CrossRefGoogle Scholar
  23. 23.
    Visser, E.: Program Transformation with Stratego/XT. In: Lengauer, C., Batory, D., Consel, C., Odersky, M. (eds.) Domain-Specific Program Generation. LNCS, vol. 3016, pp. 216–238. Springer, Heidelberg (2004)Google Scholar
  24. 24.
    Visser, E.: WebDSL: A case study in domain-specific language engineering. In: Generative and Transformational Techniques in Software Engineering (GTTSE 2007). LNCS. Springer, Heidelberg (2008)Google Scholar
  25. 25.
    Voelter, M., Groher, I.: Handling variability in model transformations and generators. In: Domain-Specific Modeling (DSM 2007) (2007)Google Scholar
  26. 26.
    Warmer, J.B., Kleppe, A.G.: Building a flexible software factory using partial domain specific models. In: Domain-Specific Modeling (DSM 2006), Portland, Oregon, USA, pp. 15–22 (October 2006)Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2008

Authors and Affiliations

  • Zef Hemel
    • 1
  • Lennart C. L. Kats
    • 1
  • Eelco Visser
    • 1
  1. 1.Software Engineering Research GroupDelft University of TechnologyThe Netherlands

Personalised recommendations