Transforming UML models into Java code

You can use the UML-to-Java transformation to generate a Java™ project from Unified Modeling Language (UML) specifications and to generate Java code from a UML model.

Before you begin

Important: The UML-to-Java 1.4 transformation is deprecated, and is now called the UML-to-Java (deprecated) transformation. The UML-to-Java (deprecated) transformation contains no new functionality, and the transformation behavior is different from the UML-to-Java 5.0 transformation, which is now called the UML-to-Java transformation. You should use the UML-to-Java transformation, whether an application contains code that is compatible with J2SE 5.0 or with J2SE 1.4 or later.
You can use this transformation in both of the following round-trip-engineering (RTE) scenarios:
  • Transform a UML model into code, change the code, and then transform the changed code into UML (model-code-model)

    By default, IBM DevOps Model Architect supports this scenario.

  • Transform existing Java code into a UML model, change the model, and then transform the changed model into Java code (code-model-code)
    To use this transformation in a code-model-code scenario, which begins by running the Java-to-UML transformation, you must link the existing Java code elements to the UML model elements in the model that the Java-to-UML transformation generates. This linking adds annotations and comments to the code so that the UML-to-Java transformation can propagate the UML changes to the Java code, and preserve existing method bodies. You should link the elements before you modify the recently added model elements and run the UML-to-Java transformation. After you link the elements, subsequent transformations merge as you expect.
    Note: To link the Java code elements to the UML model elements, on the Main page of the UML-to-Java transformation configuration, click Link Java to UML.

    For more information about this scenario and merging changes when you develop in both Java and UML, see the related concept topic below.


Feedback