logo

MoTMoT :: Documentation

  Tutorial: Transformations between models
conforming to different UML profiles

<< Author: Pieter Van Gorp >>

These pages describe how one can use MoTMoT to develop transformations between UML models that conform to different profiles. After introducing the UML profile mechanism, the profiles for the input and output models of this tutorial are introduced. Next, the sample SDM transformation (encoded in a UML profile as well...) is presented. After a short explanation of the visual model transformation, the generated JMI code is discussed.

Page 1 - 2 - 3 - 4 - 5 - 6

UML Profiles

A UML profile is a packaged set of stereotypes and tagged values that allows you to decorate a UML application with extra meta-information without changing the MOF representation of the UML metamodel.
You can make the distinction between the definition of the new meta-types and their application on an actual UML application but all of this is stored at the M1 level. Stereotypes can be regarded as subclasses of existing UML metaclasses whereas tagged values can be regarded as attributes of such new virtual metaclasses. Using UML profiles is considered to be a "light-weight" approach to metamodeling using "virtual" metaclasses because extending a metamodel conventionally (i.e. with MOF) requires model repository interfaces (e.g. JMI interfaces) and interchange formats (e.g. XMI schema's) to be adapted while in the case of profiles, any UML compliant editor can be used to create, exchange and visualize domain specific models.
The fundamental difference between the heavyweight (MOF-based) and lightweight (Profile-based) approach to metamodeling is that the former realizes the conforms-to relation by means of an instance-of relation between model element and metaclass whereas the latter is based on a has-a relation between model element and stereotype.

Figure 1 illustrates that at the M2 level (where model transformations are defined) one can navigate between a UML model element and its stereotypes by traversing the association with ends "stereotype" and "extendedElement". Similarly, by following the association with end "taggedValue", one can obtain all tags applied to a given model element. Not every stereotype can be applied to any model element: through the "baseclass" property, it is related to the metaclass being extended. When defining a stereotype, one can restrict that for example an "entity" stereotype can only be applied to UML Classifier instances. Figure 1 also shows that in UML 1.4, tags can be typed through the tagType property of a TagDefinition. Finally, TagDefinitions can be associated with a particular stereotype. Profile definitions should be bundled by putting stereotypes and tags into a package on which the (OMG UML standardized) "Profile" stereotype is applied. MOF/UML compliant tools allow one to export such packages as modules. Such a module can be imported and shared across applications that apply that particular profile.

Page 1 - 2 - 3 - 4 - 5 - 6

SourceForge.net Logo   Valid XHTML 1.0!   Valid CSS!   Get Firefox!   tegen softwarepatenten