Ever since the release of Rational Rhapsody 8.0.6, the ability to format code generation has just become BIGGER and BETTER.
Take a look at the list of properties that could be used to format the code as you want.
Every element like Class, Operation, Attribute and other model elements has its own property. The list is quite huge. These properties can be modified at the element level or its owner level. Even the specification and the implementation files have their own set of properties. As can be seen from the screenshot above, Rhapsody has separate section called WriterTemplates (which are defined under the CPP_CG).
Each of this property consists of "[[...]]" containing the code generation extractor keywords within them.
Let's have a look on CPP_CG::WriterTemplates::ClassSpec
The code for the class will be generated in the following way by default:
[[$description
]][[$annotation
]]$prolog[[$template <$parameters> ]][[$friend ]]$classtype[[ $modifier]] $name[[$bind]][[ : $superlist]][[$bracesPosition]]{[[
$body]]
};$epilog
If you want the description of the class to be generated after the body of the class, you would just need to modify the value of this property as:
[[$annotation
]]$prolog[[$template <$parameters> ]][[$friend ]]$classtype[[ $modifier]] $name[[$bind]][[ : $superlist]][[$bracesPosition]]{[[
$body]] [[$description]]
};$epilog
Quite interesting indeed!!!