Overview of Java Reverse
Introduction
Reversing an application or a part of an application consists of creating a project that represents the application. A Java application can be reversed from either its Java source files or compiled binaries (*.jar and *.class). In both cases the project is created, yet it appears that the result is more complete when the reverse is carried out from the source files.
In both cases, Objecteering will produce the best possible model.
However, the reverse operation is not defined or scarcely defined for certain code constructions, either because they are not directly in tune with the UML norm, because they are very specific to Java, or simply because they are not recommended for an object-oriented approach. This introduces some restrictions in the Reverse tool’s ability to retrieve some parts of the code in the UML modeling project. For more information on these restrictions, please see "Restrictions and workarounds".
Note: The Reverse tool is compatible with JDK versions 1.3 and more recent.
Source mode
This reverse mode is run from the application sources. Using this mode, it is possible to retrieve:
· The complete structure of the application to be reversed
· The complete code of the classes and methods.
· Some options make it possible to fit the quantity of retrieved elements to your needs. For more information, please see "Objecteering Java Developer parameters".
Binary mode
Java class libraries are essential elements in Java programming. The Reverse tool enables the integration of these basic libraries into Objecteering, by recreating Objecteering classes from compiled Java files.
In this mode, only the application’ structure is retrieved and integrated as a model.
The Objecteering Java Developer Reverse uses compiled files to build class structure. Compiled files can either exist independently or can be compressed in .zip files or .jar files.
Mixed mode
It can occur that a Java application is built from both the source files available at the time of the reverse and components available in binary version only (*.jar and *.class).
The Reverse tool will perfectly adapt itself to the situation and will retrieve:
· The complete structure of the application to reverse for the set of sources and binaries
· The complete code of the classes and methods for the parts available as sources.
Reversing libraries
Java class libraries are essential elements in Java programming. The Reverse tool makes it possible to integrate these basic libraries into Objecteering, by recreating Objecteering classes from compiled Java files.
During this operation, modeled classes and packages are rebuilt from the sources available in the class libraries. In this way, the user can use library elements within his own application.
The Objecteering Java Developer Reverse uses compiled files to build class structure. Compiled files can either exist independently or can be compressed in .zip files or .jar files.
Configuring reverse operations
Reverse parameters should be defined very carefully. There is a large diversity of architecture, style and coding quality of the Java applications to be reversed, which is why the Java Reverse tool offers such a variety of options to produce the best possible model.
Using reversed classes: benefits of the Java Reverse
The main advantages of reversing Java components into a project are:
· the display of the reversed classes (in a structure of packages, attributes, associations, operations)
· the specialization of the reversed classes and the redefinition of their methods
· the visualization of documentation and code associated with the reversed elements, when the source code is available
· the possibility of continuing to develop your UML modeling projecting project
· the advantages of the capabilities of Objecteering in domains such as modeling, model consistency checking, code generation, documentation generation and production of automatic tests
Warning
A class reversed into a project receives an identifier just like an object created in the Objecteering explorer or graphic editor.
If two users reverse the same class into two different projecting projects, Objecteering will consider them as two different objects.
To avoid losing the links towards the reversed classes during the import, it is necessary to run the reverse in a reference modeling project from which each user imports the used classes.