Type-Safe Model Transformation Languages as Internal DSLs in Scala

Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 7307)


Although there are powerful model transformation languages (MTLs) like ATL, model-to-model transformations still are often implemented in general-purpose languages (GPLs) like Java, especially in EMF-based projects. Developers might hesitate to learn another language, use new tools, or they feel limited by the specific but less versatile constructs an MTL provides. However, model transformation code written in a GPL is less readable, contains redundancies or verbose expressions, and there are fewer possibilities for formal reasoning. Our approach combines some benefits of MTLs with GPL programming. We use the GPL Scala to realize MTLs similar to ATL as internal domain-specific languages. The benefits are seamless integration with EMF and state-of-the-art tool support as well as the possibility to extend MTLs and to mix MTL and GPL code. In contrast to similar approaches with dynamically typed languages like Ruby, Scala allows for static type-safety without adding syntactic clutter.


Target Object Model Transformation Case Class Type Inference Transformation Language 
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.
    Barringer, H., Havelund, K.: TraceContract: A Scala DSL for Trace Analysis. In: Butler, M., Schulte, W. (eds.) FM 2011. LNCS, vol. 6664, pp. 57–72. Springer, Heidelberg (2011)CrossRefGoogle Scholar
  2. 2.
    Cuadrado, J.S., Molina, J.G., Tortosa, M.M.: RubyTL: A Practical, Extensible Transformation Language. In: Rensink, A., Warmer, J. (eds.) ECMDA-FA 2006. LNCS, vol. 4066, pp. 158–172. Springer, Heidelberg (2006)CrossRefGoogle Scholar
  3. 3.
    Cuadrado, J.S., Molina, J.G.: A Plugin-Based Language to Experiment with Model Transformation. In: Wang, J., Whittle, J., Harel, D., Reggio, G. (eds.) MoDELS 2006. LNCS, vol. 4199, pp. 336–350. Springer, Heidelberg (2006)CrossRefGoogle Scholar
  4. 4.
    Cuadrado, J.S., Molina, J.G.: Modularization of Model Transformations Through a Phasing Mechanism. Software and Systems Modeling 8(3), 325–345 (2009)CrossRefGoogle Scholar
  5. 5.
    Cuadrado, J.S., Molina, J.G.: Approaches for Model Transformation Reuse: Factorization and Composition. In: Vallecillo, A., Gray, J., Pierantonio, A. (eds.) ICMT 2008. LNCS, vol. 5063, pp. 168–182. Springer, Heidelberg (2008)CrossRefGoogle Scholar
  6. 6.
    Czarnecki, K., Helsen, S.: Classification of model transformation approaches. In: 2nd Workshop on Generative Techniques in the Context of MDA, pp. 1–17 (2003)Google Scholar
  7. 7.
    Fowler, M.: Domain-Specific Languages. Addison-Wesley (October 2010)Google Scholar
  8. 8.
    Günther, S., Cleenewerck, T.: Design Principles for Internal Domain-Specific Languages: A Pattern Catalog illustrated by Ruby. In: 17th Conference on Pattern Languages of Programs, PLoP (2010)Google Scholar
  9. 9.
    Halstead, M.: Elements of Software Science. Elsevier Science Inc. (1977)Google Scholar
  10. 10.
    Hofer, C., Ostermann, K., Rendel, T., Moors, A.: Polymorphic Embedding of DSLs. In: 7th Conference on Generative Programming and Component Engineering, GPCE 2008, pp. 137–148. ACM (2008)Google 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.
    Kiselyov, O., Lämmel, R., Schupke, K.: Strongly typed heterogeneous collections. In: Haskell 2004: ACM SIGPLAN Workshop on Haskell, pp. 96–107. ACM (2004)Google Scholar
  13. 13.
    Picard, C.: Model Transformation with Scala. Master’s thesis, Universitat Politècnica de Catalunya (2008)Google Scholar
  14. 14.
    Pointner, R.: An Evaluation of Scala as a host language for DSLs. Tech. rep., University of Central Lancashire (June 2010)Google Scholar
  15. 15.
    Sloane, A.M.: Lightweight Language Processing in Kiama. In: Fernandes, J.M., Lämmel, R., Visser, J., Saraiva, J. (eds.) GTTSE 2009. LNCS, vol. 6491, pp. 408–425. Springer, Heidelberg (2011)CrossRefGoogle Scholar
  16. 16.
    Spiewak, D., Zhao, T.: ScalaQL: Language-Integrated Database Queries for Scala. In: van den Brand, M., Gašević, D., Gray, J. (eds.) SLE 2009. LNCS, vol. 5969, pp. 154–163. Springer, Heidelberg (2010)CrossRefGoogle Scholar
  17. 17.
    Wider, A.: Towards Combinators for Bidirectional Model Transformations in Scala. In: 4th Conference on Software Language Engineering (SLE 2011). Springer (2012)Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2012

Authors and Affiliations

  1. 1.Department of Computer ScienceHumboldt-Universität zu BerlinBerlinGermany

Personalised recommendations