Type-Safe Model Transformation Languages as Internal DSLs in Scala
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.
Unable to display preview. Download preview PDF.