Information Technology Reference
In-Depth Information
explicitly defined as MOF models, and trace instance creation
and deletion is defined in the same way as the creation and
deletion of any other object.
The Operational Mappings language is an imperative
language that extends both Relations and Core. The syntax
of the Operational Mappings language provides constructs
commonly found in imperative languages (loops, conditions,
etc.). The language provides OCL extensions with side effects
that allow a more procedural style, and a concrete syntax
that looks familiar to imperative programmers. Operational
Mappings can be used to implement one or more relations from
a Relations specification when it is difficult to provide a purely
declarative specification of how a relation is to be populated.
Currently, there are several products that claim compliance
to the QVT standard. Smart QVT is the most representative
one [FRA 09]. This is an open-source model transformation
tool implementing the MOF 2.0 QVT-Operational Mappings
that is being developed by France Telecom R&D as an Eclipse
plug-in. Listing 3.9 presents an example of a SmartQVT
program to transform a class model into an RDBMS model.
In line 2, the source model ( srcModel ), source metamodel
( ClassMetamodel ), target model ( destModel ), and target
metamodel ( RDBMSMetamodel ) are presented. The main
(line 3) is the entry point to the transformation. In line 4,
srcModel.objects()[Class] returns all the elements
in srcModel that conforms to the Class metaconcept.
This operation is a shorthand for the OCL-type sentence
select(e | e.oclIsKindOf(UML::Class)) . In line 4, ->
map class2table() applies the mapping class2
table() to each returned class element. A mapping is
an operation associating an element from a model with
another element often from another model. In this case, each
Class element is transformed and associated with a Table
element. Line 5 transforms the Association elements of
classes to the Association elements of tables.
Search WWH ::




Custom Search