Skip to main content

Type-Safe Model Transformation Languages as Internal DSLs in Scala

  • Conference paper

Part of the book series: Lecture Notes in Computer Science ((LNPSE,volume 7307))

Abstract

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.

This is a preview of subscription content, log in via an institution.

Buying options

Chapter
USD   29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD   39.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD   54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Learn about institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  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)

    Chapter  Google Scholar 

  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)

    Chapter  Google Scholar 

  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)

    Chapter  Google Scholar 

  4. Cuadrado, J.S., Molina, J.G.: Modularization of Model Transformations Through a Phasing Mechanism. Software and Systems Modeling 8(3), 325–345 (2009)

    Article  Google Scholar 

  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)

    Chapter  Google Scholar 

  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. Fowler, M.: Domain-Specific Languages. Addison-Wesley (October 2010)

    Google Scholar 

  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. Halstead, M.: Elements of Software Science. Elsevier Science Inc. (1977)

    Google Scholar 

  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. Jouault, F., Kurtev, I.: Transforming Models with ATL. In: Bruel, J.-M. (ed.) MoDELS 2005. LNCS, vol. 3844, pp. 128–138. Springer, Heidelberg (2006)

    Chapter  Google Scholar 

  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. Picard, C.: Model Transformation with Scala. Master’s thesis, Universitat Politècnica de Catalunya (2008)

    Google Scholar 

  14. Pointner, R.: An Evaluation of Scala as a host language for DSLs. Tech. rep., University of Central Lancashire (June 2010)

    Google Scholar 

  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)

    Chapter  Google Scholar 

  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)

    Chapter  Google Scholar 

  17. Wider, A.: Towards Combinators for Bidirectional Model Transformations in Scala. In: 4th Conference on Software Language Engineering (SLE 2011). Springer (2012)

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2012 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

George, L., Wider, A., Scheidgen, M. (2012). Type-Safe Model Transformation Languages as Internal DSLs in Scala. In: Hu, Z., de Lara, J. (eds) Theory and Practice of Model Transformations. ICMT 2012. Lecture Notes in Computer Science, vol 7307. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-30476-7_11

Download citation

  • DOI: https://doi.org/10.1007/978-3-642-30476-7_11

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-642-30475-0

  • Online ISBN: 978-3-642-30476-7

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics