Round trip engineering

 

Overview of round trip engineering

Round trip engineering is a functioning mode that combines code generation and reverse engineering. 

 

Unlike the model driven mode, the round trip mode allows the model to be directly modified at code level.  The code is then fully reversed, in order to update the model.

 

Objecteering can work with Eclipse in either Round Trip Engineering (RTE) or Model Driven Engineering (MDE) mode.  The default functioning mode is the RTE mode.

 

In RTE mode, Objecteering and Eclipse play two distinct roles:

·         Objecteering Modeler guarantees that the UML model is semantically correct, by applying consistency checks that permanently assist you.  You can then generate your model's Java code using the Java Developer MDA component.

·         Eclipse guarantees that the Java code generated by Objecteering is managed and correctly compiled, and that any (possible) modification of the Java source code is transferred into the model. Eclipse notifies Objecteering of any modification (identified) in the source code.

 

 

Specializing a model for a specific technological target

The screenshot below shows that at this point, the UML model is a Platform Independent Model (PIM).  It is not in any way specialized for a specific technological target, for example Java.  In order for model mapping (with a class as illustration) to address Java code generation, an artifact called a Java generation work product must be associated with our modeling branch.  This Java generation work product will accompany the UML element it belongs to throughout the development process.

 

At this point, the model is not specialized for any specific technological target

 

 

A Java generation work product is used to map the model element it belongs to into Java code.  Java generation work products have an access path where the Java source code generated by Objecteering is stored.  This access path uses the information entered when creating the Objecteering project in Eclipse.

 
To create a Java generation work product, simply select a class or package and click on the  icon in the Model Explorer.  The “Java generation work product” window then appears.

 

The “Java generation work product” window

 

Source code and compiled code can be located in two separate directories.  As the developer, it is up to you to decide how to organize yourself.

 

Java generation work product artifacts in Objecteering provide dedicated, contextual services in the Objecteering and Eclipse environment.  If you right-click on a Java generation work product artifact, the "Generate" command can be run, which automatically transforms the model into Java source code.

 

An example of Java code generated for an Objecteering model