Introduction

Reversing an application or a part of an application is the operation that consists of creating a project that represents the application.

However, the reverse operation is not defined or scarcely defined for certain code constructions, either because they are not directly in tune with the UML norm, because they are truly specific to Cxx or simply because they are not recommended for an object-oriented approach.  This introduces some restrictions in the reverse tool’s ability to retrieve some parts of the code in the project.

The Modelio Cxx Reverser reverse function is used to build a UML model from Cxx source code. This UML model creation based on Cxx code is carried out over several stages.  Each of these stages will be presented and explained in this chapter.

The Cxx code is transformed into a UML model annotated by a set of notes and tagged values from Cxx Designer.  Modelio uses specific modeling techniques for this model annotation.  For information on equivalents, see "Equivalence between Cxx source code and the UML model".

Modelio Cxx Reverser is a specific module that depends on the Cxx Designer module and that must be deployed before performing any reverse operation.

Cxx Reverse functioning

The Cxx Reverse functions over two stages:

  • The first phase consists of analyzing the Cxx source code which is to be reversed. Once this analysis has been successfully completed, the application is modeled in the form of a tree.  At this stage, nothing is imported into Modelio.

  • During the second phase, the elements selected by you are reversed in Modelio. The selected elements are reversed in the form of a UML model in Modelio, and the UML elements obtained are annotated in accordance with the Cxx development module present in Modelio.

image
Diagram of Cxx Reverse functioning
Warning

A class reversed into a project receives an identifier just like an object created in the Modelio browser or graphic editor.

If two users reverse the same class into two different projecting projects, Modelio will consider them as two different objects.

To avoid losing the links towards the reversed classes during the import, it is necessary to run the reverse in a reference modeling project from which each user imports the used classes.