Yet Another Model Transformation Language (YAMTL) provides a fresh approach to model transformation by favouring agility, interoperability, reuse, expressivity and performance. With YAMTL, model transformations can be easily integrated within JVM programs and model transformation programs can reuse the JVM tool ecosystem too.

Model transformation (MT) is traditionally used to translate models between different modeling languages, including the manipulation of data that is modeled using an object-oriented notation, such as UML. This defining characteristic makes it an ideal candidate for developing low-code application platforms by, for example, automating both translation tasks and reverse engineering tasks. MT languages offer advanced programming (modeling?) constructs that help domain experts capture the semantics of a particular MT without spending time in developing MT machinery. Designing such constructs – like advanced pattern matching with programmable matching strategies, rule reuse mechanisms, rule composition, traceability, incremental evaluation, to name a few – requires expertise, practice and research. MT languages embed all this knowledge and offer it to application domain experts using the language syntax as the user interface.

Most MT languages offer their own tool workbench (IDE, parser, type checker, etc.), which cannot compete with industry-backed programming languages. YAMTL approaches model transformation (MT) by providing MT functionality as a Java dependency and by extending the syntax of Xtend, a dialect of Java, to define model transformations. Java tools and IDEs can then be used to define, analyse and refine MT programs. Moreover, YAMTL has been designed taking into account expressiveness and performance in mind, working towards open research challenges in MDE.

YAMTL is a model transformation language fully interoperable with Java, expressive and very fast Click To Tweet

Enabling Model Transformation from Xtend/Java Programs

YAMTL comes equipped with advanced model transformation features that can help in implementing any kind of model transformation: as expressive as state-of-the-art model transformation languages, such as ATL; powerful model pattern matching with local-search programmable plans; reuse via multiple rule inheritance and module composition; compiled to Java; full interoperability from/to Java; and additional facilities inherited from Xtend (templates for code generation, IDE, debugger, and Java extensions).

A paradigmatic example of model transformation in MDE translates a class diagram representation of a data model into a relational schema representation. This transformation requires:

  • The languages of the models to be transformed, which are the class diagram and relational database metamodel, as shown at the top of the figure.
  • A source model, a class diagram in this case, shown in abstract notation at the bottom left of the figure.
  • A model transformation definition taking a class diagram and producing a relational schema (both class diagrams and relational schemas are considered models). The execution of the transformation on the input class diagram produces the relational schema, shown in abstract notation at the bottom right of the figure.

Classical class to relational model transformation

The declaration of a YAMTL transformation starts by creating a Xtend class that extends the class YAMTLModule.

YAMTL transformation definition

Within its constructor, it declares three main components:

  • The header of the transformation, declaring the name of the transformation, the type of input model (the class diagram metamodel) and the type of the output model (the relational schema metamodel).
  • The rule store, where declarative or imperative rules can be created defining mappings between the source and the target metamodels. The presentation of the language at the MODELS’18 conference covers the main language constructs used to define transformation rules.
  • A helper store, declaring queries managed by the YAMTL engine that are helpful to reuse code when defining tranformation rules. Additional helpers, declared as plan Xtend/Java methods or fields, can also be part of the definition of transformation rules, offering the possibility of reusing all available JVM libraries for defining transformation. Managed helpers have the added advantage that they are computed up-front and just once.

YAMTL has been tested with very large models, consisting of millions of elements, and with robust benchmarks, faring reasonably well with respect to other well-established MT tools.

Why using YAMTL?

In a recent survey on the future of MT languages, respondents enumerated a number of reasons for not using MT languages. In the table below, we indicate how YAMTL tackles some of those challenges:

Reasons for not using MT YAMTL solution
Complex setup and IDE-specific dependencies Use mature Xtend IDE/Java ecosystem
No real debugging Use mature Xtend/Java debugging techniques
Not adapted to the web As a Maven dependency, YAMTL can be used in Java web projects (server-side)
Performance Our experiments (see papers below) show that performance is a strong point of YAMTL
ATL when simple transformations, Java when complex transformations YAMTL integrates model transformation features in Xtend programs
Cost in training staff Use plain Java with the YAMTL dependency

Some use cases that have already been documented are:

  • The encoding graph queries over very large social networks, that need to be re-evaluated in the presence of sparse changes to the network. This use case illustrates YAMTL’s incremental evaluation engine and shows how to implement graph queries, whose evaluation is incremental, using model transformations. (SOCIAL)
  • Visualization of inconsistency reasons in a consistency maintainer by exploiting YAMTLs internal traceability model. This use case shows how YAMTL’s language is extended with inconsistency specifications that enable the identification of atomic
    model updates that lead to fine-level inconsistencies, and how its semantics is reused to implement an admissibility checker for model updates. (BIB2DOC)
  • Computation of reduced ordered BDDs employing YAMTL’s pattern matcher and Java data structures. This use case showcases several
    features of YAMTL: interoperability with Java data structures via Xtend; application of rules in stages using
    priorities; declarative rules with side effects, one of which is transient. (TT2BDD)

Trying YAMTL…

Using a YAMTL transformation is as easy as…

  1. Importing the YAMTL dependency in your Java project and your EMF-based metamodel projects.
  2. Declaring a model transformation. See any of the following examples:
  3. Executing the model transformation (code snippet in Xtend):
val xform = new cd2db 
xform.loadInputModels(#{'cd' -> inputModelPath}) 
var String outputModelPath = '''src/main/java/cd2db/targetInitial.xmi''' 
xform.saveOutputModels(#{'db' -> outputModelPath})
Want to know more?

If you want to know more about YAMTL, check the following resources:

Papers analysing the performance of YAMTL:

Feel free to contact Artur Boronat if you need help in using the tool or want to know more about YAMTL.

Want to build better software faster?

Want to build better software faster?

Read about the latest trends on software modeling and low-code development

You have Successfully Subscribed!

Pin It on Pinterest

Share This