Modelio Java Architect reverse is the operation that consists in creating a Java annotated UML model from existing code. The existing code can be either:

  • a set of Java source files, this is called source reverse

  • a JAR file containing compiled Java classes which is called binary reverse

Source reverse scenarios

The most common usage of source reverse, consists in retro-engineering some existing legacy code which has become difficult to understand and maintain, in order to carry out the required re-factoring tasks in a model rather than directly in the code.

Models usually provide a good synthesis of the design and structure of an existing piece of code which really helps re-factoring tasks.

Another usage of source code reverse occurs when a development project has been started in classical code writing mode, as it was initially only a kind of proof of concept or exploring work. Now that the moment has come to make of it a more solid and industrial implementation, reversing this initial code allows to switch to the more robust and reliable model driven approach.

Binary reverse scenarios

Reversing compiled code is another story. The most common situation where reversing Jars occurs is when you need to use the contents of some external libraries in your model.

For example, you want to use the Dialog class of the SWT library in your model. In such case reversing the SWT jars creates a model where the expected Dialog class will appear and become usable for modeling your own application. Of course, the Dialog class is not expected to be modified by you or your team, so you will probably choose to embed this reversed SWT model in a RAMC component as a read-only model element.

See the general Modelio documentation for more information about RAMC components. Note that for this usage of the reverse, Java Architect provides several options to reverse only a simplified and light model from a library.

Tip Several commonly used Java libraries have been reversed by Modelio and are available for download at the Model component store in the form of RAMC components. Save some effort and simply download these RAMCs and install them in your model.