Specifying the UML package structure that Java-to-UML transformations generate

You can specify whether the transformation generates a flat UML package structure in the target UML model for each Java™ package in the source Java project. If you do not specify that the transformation generates a flat packages structure, the transformation generates a hierarchical packages structure.

If the transformation target is an existing UML model, you should specify the same package structure as the target model; this reduces the number of differences that you must resolve between the target model and the temporary model that the transformation generates.

For example, assume that a source Java project contains the classes “a.b.Y” and “a.b.c.Z”. If you have the transformation generate a flat packages structure, the transformation generates UML packages a.b and a.b.c. These packages are not hierarchical. UML class Y is created in UML package a.b, and UML class Z is created in UML package a.b.c. If you have the transformation generate a hierarchical package structure, UML package a is created; UML package b is created in package a; UML package c is created in package b; UML class Z is created in package c; and UML class Y is created in package b.

To specify that the transformation generates a flat UML package structure in the target model:

  1. In the Project Explorer view, right-click a transformation configuration file; then click Open.
  2. Click the Java to UML options tab.
  3. On the Java to UML Options page, select the Generate a flat UML package structure for each Java package check box.
  4. Click File > Save.
The options are applied the next time that you run the transformation.
Note: If you create a new transformation configuration, you can specify this information on the Java to UML options page of the New Transformation Configuration wizard.

Feedback