Chapter 14 Working with Java


Reverse Engineering Java

You can reverse engineer files that contain Java classes into an OOM. For each existing class in a Java file, a corresponding class is created in the OOM, with the same name and containing the same information.

When you reverse engineer a Java class that already exists in a model, a Merge Model window will open, allowing you to specify whether to replace existing classes, or to retain the existing class definitions in the model.

Steps To reverse engineer java code:

  1. Select Language→Reverse Engineer Java. to open the Reverse Engineer Java dialog box:
  2. Select one of the following file formats from the Reverse engineer list:

  3. Click the Add button to browse to and select the files or directories to reverse, and then click Open to return to the Reverse Java dialog box, which now displays the selected files.

    You can repeat this step as many times as necessary to select files or directories from different locations.

    You can right-click any of the files and select Edit from the contextual menu to view its contents in an editor.
  4. [optional] Click the Options tab and specify any appropriate reverse engineering options. For more information about these options, see "Reverse Engineer Java Options tab"

    Note   Reversing without the body of the code
    You can choose to reverse .java source files without their code body for visualization or comparison purposes, or to limit the size of your model if you have a very large number of classes to reverse engineer. To do this, select the Ignore operation body option.

  5. Click OK to begin the reverse engineering process. If the model in which you are reverse engineering already contains data, the Merge Models dialog box will open to allow you to specify whether to control whether existing objects will be overwritten.

    For more information on merging models, see section Merging Models, in chapter Comparing and Merging Models in the General Features Guide .

    PowerDesigner creates a class in the model for each class definition in the reversed files. The classes are visible in the Browser and, by default, symbols are created in one or more diagrams

 


Copyright (C) 2005. Sybase Inc. All rights reserved.