Thursday, October 17, 2013

QVT Operational Mappings

Since quite while ago, I've wanted to blog about QVT (which stands for Query/View/Transformation) Operational Mappings. QVT is the open specification established by the Object Management Group (OMG) in order to define Model to Model (M2M) transformations. M2M transformations are a key part of Model-Driven Engineering (MDE), and having an open specification which leans towards an standarized way to describe them is simply what I want and pursue. Unfortunately, there hasn't been too many tools implementing this specification, being other M2M transformation languages, such as ATL or ETL, more popular.

QVTo Transformation
QVT consists of three languages, two declarative languages called Relations (QVTr), Core (QVTc) and a third imperative one called Operational Mappings (QVTo). Today, I'm talking (including some Eclipse QVTo updates :) ) about the last one since it's the language which I'm mostly familiarized with...


At the best of my knowledge, I could say that Eclipse QVTo is by far the best QVT Operational Mapping language implementation you may find, which, providing it's an open source and hosted as an official Eclipse project, is definitely your best choice to deal with. Although the support to whole language is not completed, the project provides nice textual editors, a high quality environment to execute and debug transformations, etc.


Transformation launch configuration.

Regarding its current status and further evolution, it was discouraging having the initial developers team being dissolved after Borland acquirement by Micro Focus which leaded to have the project quite dormant during roughly three years. However, this year the project has gained momentum since some changes have been taking place:

  • Firstly, I've been promoted as committer for the project which allowed me to review and commit several fixes and enhancemennts for the Kepler release contributed by Christopher Gerkin, whose efforts have been rewarded to promote him as a new project committer as well. 
  • Secondly, one of the original committers (actually the current project leader), Sergey Boyko, is quite active again which is allowing the project to reasonable evolve towards a more robust one.
  • Finally, my research project revolves around the QVTo language, so don't have any doubt that new enhancements and further alignments with the specification will take place.

To conclude this post, I'd like to highlight, for those readers more familiar with M2M transformations, some of  the features which I mostly love from the this M2M language:

  • Black-boxing. Allows you to define operations which are implemented out of the transformation (e.g. in Java language. For instance, I've used this functionality to implement some Eclipse IProgressMonitor mechanism, so that you can observe informative progress in long running transformations inside the Eclipse IDE.
  • Libraries. Allows you to create libraries with useful operations to be used by your transformations. For example, think of a reusable library which includes some helpers to deal with an Eclipse IProgressMonitor. 
  • Intermediate data. Allows you to define and create intermediate data (classes and properties) which you may require during a transformation (but it's not subject of the involved transformation parameters) 
  • Transformations extension. QVTo transformation can be extended (conceptually, similar to the class inheritance concept in OOP), so that complex transformation can me modularized into smaller and reusable ones.
  • Transformations chaining. QVTo transformations can instantiate and orchestrate other QVTo transformations!.

As you may imagine, the possibilities that these overall features provide are infinite to build a complex model transformations framework for powerful MDE tools ;).

P.S: I also want to thank Ed Willink for his efforts to have this project moving forward.

5 comments:

  1. Hi,

    Interesting topic THANK you. You know for QVT-O we have very limited documentation and "how to" tutorials for beginners.!

    Anyway, I love the features that you have listed above. Could you please give us example of how to use it or redirect us to tutorial.

    thank you again

    ReplyDelete
    Replies
    1. Hi Naif,

      Apart from the specification, and as a general QVTo introduction, I could recommend the following slides:

      https://www.eclipse.org/m2m/qvto/doc/EclipseCon_2009.ppt

      Some blackbox libray usage:

      http://help.eclipse.org/kepler/topic/org.eclipse.m2m.qvt.oml.doc/references/blackboxing.html?cp=44_1

      In the project repository, there are plugins with test cases which have a lot of QVTo examples. For instance the followign plugin:

      http://git.eclipse.org/c/mmt/org.eclipse.qvto.git/tree/tests/org.eclipse.m2m.tests.qvt.oml

      I could also to point you to a simple example of how transformations are chained:

      The following transformation:

      http://git.eclipse.org/c/mmt/org.eclipse.qvto.git/tree/examples/org.eclipse.qvto.examples.build/src/org/eclipse/qvto/examples/build/qvto/QVToCSDuplicatedNamesDetection.qvto

      chains the execution of the following one with different transformation parameters in each execution:

      http://git.eclipse.org/c/mmt/org.eclipse.qvto.git/tree/examples/org.eclipse.qvto.examples.build/src/org/eclipse/qvto/examples/build/qvto/DuplicatedNamesDetection.qvto

      I hope it helps.

      Cheers,
      Adolfo.

      Delete
    2. Hello Adolfo,

      Yes definitely it helps

      THANK YOU :)

      Delete
  2. Hi, I'm a beginner at MDA, I want create a CIM ,PIM and PSM. I need help how can i transform a reference( extends , include )plz help me

    ReplyDelete