MOF QVT

from Wikipedia, the free encyclopedia

Query View Transformation ( MOF QVT ) is a specification of the Object Management Group that describes a (programming) language for model-to-model transformations. QVT is part of the Meta Object Facilities ( MOF ), a collection of documents from the OMG for the formal definition of models and their application, such as is required in the context of model-driven architecture (MDA).

In the discussion, a distinction must be made between languages ​​that were designed by third parties in response to the “Request for Proposals” (RFP) and the QVT language as described in the specifications.

As a simple example, an ER model can be generated from a class model by transformation. In the simplest case, this requires the class and ER model and their respective metamodel, as well as a specification on how the ER model is to be generated from the class model. This regulation can be described in one of the QVT languages. As a particularly typical example, a (purely technical) analysis model can be transformed into a (technical) design model, that is, the transformation adds the technology in which the model is to be implemented to the analysis model.

The acronym stands for QVT q ueries (Request), v iews (views) and t ransformations (transformations). Among requests MOF is understood formal expressions with which individual elements of a model can be selected; Views are complex queries used to select entire sections from a model; with transformations relations are represented between models. Despite the name QVT, MOF QVT is usually only understood as a standard for describing MOF model transformations, since these are considered to be the main area of ​​application of QVT and queries and views can be interpreted as parts of a transformation anyway.

construction

QVT language architecture

The QVT specification defines two types of languages : declarative and imperative . The declarative part consists of the languages QVT-Relations and QVT-Core as well as a mapping of the relations to the core language RelationsToCoreTransformation . QVT-Core behaves to QVT relations like Java bytecode to Java source code and is therefore of subordinate importance for end users. The imperative part contains the Operational Mappings Language as well as specifications for Black Box Implementations , i.e. an interface for transformation languages ​​implemented outside of QVT.

Declarative and imperative languages ​​can be used together in the following way: It is possible to implement individual relations in a relational transformation in one of the imperative languages ​​and to hook them into the relational transformation as a plug-in. This can be useful in order to implement particularly complex algorithms or to reuse existing program libraries.

The following is a simple example of a transformation in the Operational Mappings language , which maps each persistent class of a UML model to a table in an entity relationship model .

   -- Transformation von einem 'UML' Modell auf ein 'ERM' Modell

 transformation uml2erm( in uml : UML, out erm : ERM )

   -- Einstiegspunkt

 main() {
   uml.objects()[#Class]->map class2table();
 }

   -- Abbildung von Class auf Table

 mapping Class::class2table() : Table
   when { self.stereotypes->includes('persistent') }
   {
     name := self.name;
   }

The example contains the two OCL expressions uml.objects()[#Class], which selects all classes of the UML model, and self.stereotypes->includes('persistent')which checks whether the class (self) is of the stereotype 'persistent'. The method main()is the starting point of the program. It applies the mapping class2tableto all classes of the UML model , which creates a table in the ER model from the transferred class.

The QVT metamodel (which defines QVT) is based on the metamodels of EMOF and Essential OCL . The latter is expanded to include imperative functions (imperative OCL).

application

Requirements: QVT transformations are based on the meta models of the respective input and output models. These must therefore be available to carry out the transformation. By using the metamodels, images can be defined based on the element types. In this way, a transformation can define a mapping in such a way that, for example, all elements of the EntityType type from an ER model are transformed into one element of the class type in the class model. The metamodels must be described for QVT using the MOF.

The importance of QVT lies in the model-to-model transformation within the framework of model-driven architecture. In contrast to the previously common model-to-code transformation, a Platform Specific Model (PSM) can be created not just as source code, but as a model. The source code can then be generated from this later in a second step. Thus, the PSM as a real model also has the advantages of modeling at the level of the technical architecture compared to a purely source-code-based software development ( see also Unified Modeling Language or Software Engineering ).

Typical usage scenarios for QVT languages ​​are:

  • Verification of models
  • Unidirectional and bidirectional model transformations (N-directional ones are also possible, but of little relevance)

In the context of transformations, elements of models can be created, replaced or deleted. For this purpose, traces between models can be maintained. These are assignments between elements of the different models, which state which element was mapped to which. This is necessary in order to be able to consistently create, replace or delete elements.

Implementations

A distinction must be made here between implementations based on the RFP and the specification, in the case of the latter, which part (operational, relational, core) has been implemented and which version of the specification serves as reference. In the case of answers to the RFP, “only” the requirements described in the RFP were (partially) implemented, so the scope and syntax of the languages ​​can differ greatly from one another.

Surname Manufacturer (distributor) QVT Operational QVT Relational QVT Core License annotation
Borland Together Architect Borland X commercially based on the previous version of the specification
SmartQVT France Telecom R&D X Open Source (EPL) Java-based implementation, Eclipse plug-in
medini QVT ikv ++ technologies ag X * Open Source (EPL) * does not yet support collection patterns
ModelMorf TRDDC X * commercially * not completely
Tefkat University of Queensland ( SourceForge ) Open Source (LGPL) Eclipse plugin, uses EMF
Atlas Transformation Language ATLAS INRIA & LINA (Eclipse Foundation) Open source Hybrid language (combines relational and operational concepts)
Eclipse MMT project Eclipse Foundation planned Open Source (EPL) The operational part is located in the Eclipse Incubator, test versions (of the operational part) are available.

Individual evidence

  1. a b OMG: MOF 2.0 Query / Views / Transformations RFP. ad / 2002-04-10. Needham, MA: Object Management Group, April 2002. omg.org
  2. OMG: Meta Object Facility (MOF) 2.0 Query / View / Transformation Specification. Final Adopted Specification ptc / 07-07-07. Needham, MA: Object Management Group, July 2007. omg.org
  3. a b c OMG: Meta Object Facility (MOF) 2.0 Query / View / Transformation Specification. Version 1.0 formal / 08-04-03. Needham, MA: Object Management Group, April 2008. omg.org
  4. borland.com ( Memento of the original from December 14, 2006 in the Internet Archive ) Info: The archive link was automatically inserted and not yet checked. Please check the original and archive link according to the instructions and then remove this notice. @1@ 2Template: Webachiv / IABot / www.borland.com
  5. smartqvt.elibel.tm.fr ( Memento of the original dated December 9, 2006 in the Internet Archive ) Info: The archive link was inserted automatically and has not yet been checked. Please check the original and archive link according to the instructions and then remove this notice. @1@ 2Template: Webachiv / IABot / smartqvt.elibel.tm.fr
  6. ikv.de
  7. tcs-trddc.com ( Memento of the original from November 19, 2006 in the Internet Archive ) Info: The archive link was inserted automatically and has not yet been checked. Please check the original and archive link according to the instructions and then remove this notice. @1@ 2Template: Webachiv / IABot / www.tcs-trddc.com
  8. tefkat at SourceForge
  9. Model to Model Transformation - MMT - Eclipsepedia