Class to Service Transformation Using Multiple Rules

This transformation converts an abstract model in which UML classes represent high level classes to a more specific UML model where each high level class in the abstract model is transformed into an interface, an implementation class and a factory class.

The transformation accepts a top level UML class as the source and generates the above three classes by carrying out the following mappings:

A top level class is a class that is contained directly in a package or a model. An inner class which is contained in another class is not a top level class.

If you choose a model or a package as the source, the transformation generates output classes for each of the top level classes in the model or the package.

This transformation uses a set of rules and several transforms to carry out the above mappings.


Running the Transformation

To run the transformation:

  1. Start the run-time workbench.
  2. In the run-time workbench, create an UML model containing a class with a few attributes and operations. This is your source model.
  3. In the run-time workbench, create another UML model with a package in it. This is your target model.
  4. Right-click a class, a package, or the model in the source model; then click Transform > Run Transformation > Class to Service Multiple Rules.
  5. In the Run Transform window, on the Target page, select the package in the target model or the target model itself.
  6. Click Run.

The transformation generates the interface, implementation and factory classes and places them in the specified target package. If you choose the target model on the Target page, the transformation places the generated classes in a package named, ClassToServiceOutput, in the target model.


Transformation Details

Transformation Source

This transformation accepts a UML model or a package or a top level class as the source. It will not accept an inner class as a valid source.

Transformation Target

This transformation accepts a model or a package as its target.