Handy tips
Reverse
Before all reverse operations, make sure that the classes you wish to reverse are properly compiled and can be accessed through the ClassPath specified during reverse configuration. The reverse command uses .java and .class files to carry out its operations.
Multiple multiplicity associations and attributes
For multiple multiplicity associations and attributes created in Java, Objecteering can, in round trip mode, recreate the correct association or attribute through an accessor in C getXXX() form.
In this case, if C is a non-primitive class, an association towards C, with XXX as its role, is created.
If C is a type or a primitive class, a C type attribute called XXX is created.
Visibility is the same as that of the accessor.
Generation markers
Even in round trip mode, Objecteering Java Developer generates "user" code between the "//START OF MODIFIABLE ZONE …" and "//END OF MODIFIABLE ZONE …" markers, in order to be able to differentiate between the code generated by Objecteering (invariants, pre and post-conditions, …) and the code written by the user.
During reverse operations, these markers are deleted. For methods, as well as markers, the code before the start marker and after the end marker is deleted, in order not to generate invariants, pre-conditions and post-conditions several times.
Managing imports
During the reverse, imports are transformed (where possible, in other words, where the imported element is modeled) into a use link in the model.
Thus, an "import P1.P2.C1;" line in the reversed Java source for the "C" class is translated in the model by a use link from the "C1" class to the "C" class, if the "C1" class exists in the model and is contained in the "P2" package, which is itself contained in the "P1" package.
Collections
If you are adding a collection type attribute to your Java code, remember to create a "standardized" accessor, so that reverse engineering will be properly carried out.
For example, do not write:
class Company {
public
Vector Addresses ;
}
but rather:
class Company {
private
Vector Addresses ;
public Address getAddresses (int idx) {
return Addresses.elementAt(idx) ; }
}
In this way, reverse engineering will detect a 0..* association from the "Address" class to the "Vector" class.
Only types which can be handled by Objecteering Java Developer should be used (for details on the list of types known to Objecteering Java Developer, please see "Tagged value types").
Filtering accessors
We recommend that you generate your accessors through Objecteering and do not modify them. Check the "Filter accessors on reverse" tickbox, so that they will not be transferred into your model during reverse operations.
If you wish to write your accessors yourself, do not check the "Filter accessors on reverse" tickbox. All the accessors will then be transferred as methods into the classes. In certain cases, this can provoke errors, for example, "Several methods have the same signature".

Figure 132. Filtering accessors