C++-to-UML transformations

This content applies to version 7.5.4 or later. The C++-to-UML transformation transforms C++ code into UML model elements.

Valid transformation sources

The source that you specify in the transformation configuration must be created using the C/C++ Development Tools (CDT).

The following table lists the C++ source objects that the transformation can convert into UML elements, depending on the design contract management protocol (DCMP) that you specify in the transformation configuration:
DCMP C++ source objects
Conceptual Models Seed Concrete Models You can select one or more of the following items from one or more C++ projects:
  • C++ source folder in a project
  • C++ source file
Conceptual Models Drive Development
Reconciled Modeling You can select the following items:
  • A C++ project
  • One or more folders or source files from a single C++ project

If you select an item that is not a C++ project, the reverse, or UML-to-C++, transformation determines the C++ project of the first item that it processes. The reverse transformation generates its output in this C++ project.

If you select C++ elements in the Project Explorer view instead of using the Transformation Configuration editor, the source elements that you select override the source project or elements that are specified in the transformation configuration. The transformation configuration is not affected and the source that you specify on the Source and Target page of the transformation configuration editor or in the New Transformation Configuration wizard does not change.

Valid transformation targets

A valid transformation target is a UML model, UML model file, or root-level package in a UML model.

Alternate file names for reverse transformation output

You cannot create mapping models for the C++-to-UML transformation. However, if the transformation configuration implements the Reconciled Modeling DCMP, you can configure the reverse, or UML-to-C++, transformation, to create mapping models that enable you to specify alternate files names for the output that it generates.

The C++-to-UML transformation uses the mapping models to determine the appropriate name for the UML elements that it generates. For example, a UML model contains PackageA, and PackageA contains Class1. When you create a mapping model for the UML-to-C++ transformation, you can specify that Class1 has an alternate file name of MappedClass1. When you run the UML-to-C++ transformation, it generates C++ files named PackageA.MappedClass1.cpp and PackageA.MappedClass1.h. When you run the C++-to-UML transformation, the transformation determines that the original UML path for the C++ element is PackageA.Class1, and generates a UML class named Class1 in a UML package named PackageA.

If the artifact file name that you specify in the mapping model is not a valid C++ file name, then the transformation modifies the name of the file when it creates the C++ code element. For example, if the mapping model specifies an alternate file name of "Mapped Class1", instead of MappedClass1, the transformation generates a C++ file named Mapped_Class1.cpp. The transformation does not keep a record of these modifications; therefore, the C++-to-UML transformation cannot map the Mapped_Class1 file to the original UML element. In this example, the C++-to-UML transformation transforms the Mapped_Class1 C++ source object into a UML class named Mapped_Class1, instead of Class1.

Comparing and merging transformation output with target UML models

The C++-to-UML transformation uses the comparing and merging functionality to determine the differences between the target model and the temporary model that the transformation generates. When you run the C++-to-UML transformation, the merge editor displays the differences between the two models. In the merge editor dialog box, you can select the changes that the transformation merges into the target model.

Integration with team support

The transformation provides integration functionality with IBM® Rational® Team Concert, CVS, Rational ClearCase®, and Rational ClearCase LT version control systems, which enables you to automatically check out files or add new files. You must enable team capabilities to work with configuration management systems.


Feedback