Variants

A variant is a customization unit for the Cxx module that must be declared in a Cxx project before being used.

Variants can be divided into the following categories:

  • ACTs

  • Generation products

  • Type libraries

You can create your own type variants by writing custom type definitions and ACTs, or use the standard one, already included in Cxx Designer.

ACTs

The core of Modelio Cxx Designer is an Active Code Template (ACT) processor.  An ACT is a python or java file to be used at generation, which groups together:

  • Instructions describing the layout and structure of code

  • Rules for the extraction of code from UML models, expressed through MDA profile methods and J code

  • Custom MDA profile method calls

  • Mappings associating ACTs and arbitrary text strings with text keys

Generation products

ACTs are linked to model elements and output files by generation products. A generation product is a python script which links a UML metaclass, a condition defining when elements of this metaclass are translated, an ACT defining how these elements are translated, and the name of the output files containing the generated code.

You can define your own generation product by associating:

  • a UML metaclass, giving its name to the product file

  • generation conditions expressed by Java expressions

  • rules to generate the output file names

  • an ACT defining the output

This means that you can define custom output, in addition to generated Cxx code (IDL definitions or Java Native Interface wrappers, documentation in custom format, and so on).

Modelio Cxx Designer can simultaneously support a number of generation product definitions.

Type libraries

A type library groups together definitions of types. A type definition associates a UML type with a Cxx declaration, where the name of a UML structural feature or operation parameter will be substituted, and a list of include directives required to use the Cxx type.

A UML type can be a primitive type, a data type or a collection type. Collection types are used to represent attributes and association ends with multiple cardinalities. The definition of a collection type also provides a high-level description of collection semantics – such as "OrderedCollection" – which is mapped to decorations automatically deduced from high-level UML model properties. This allows Modelio Cxx Designer to automatically express high- level UML model semantics through particular Cxx collection types.

When Modelio Cxx Designer translates a structural feature or an operation parameter, it constructs the Cxx declaration in accordance with its type and the current type library, and executes ACTs defined in the library, if they override the core ACTs defined for the element.