Activity diagrams Code generation In previous releases, Rational Rhapsody supported code generation only from activity diagrams associated with classes, not from activity diagrams associated with operations or use cases. Rational Rhapsody Developer for C++ generates functor-based code for activity diagrams associated with operations. Functor-based code reuses the code generation functionality for activity diagrams of classes. Code is generated into a new class (called the functor class ), which implements an activity diagram on the class level. The task of executing the modeled operation (an operation associated with an activity diagram) is delegated to the new class.
The class that delegates the task is known as the owner class . You specify whether to generate code for an activity diagram by setting the property CPP_CG::Operation::ImplementActivityDiagram to Checked . This property is set to Cleared by default. Functor classes Consider the following class: The following figure shows the activity diagram associated with the increaseSpeed modeled operation. 652 User Guide