Chapter 25. Code Engineering

  1. Home
  2. Docs
  3. Chapter 25. Code Engineering
  4. 1. Instant Reverse
  5. How to generate UML Sequence Diagram from Java

How to generate UML Sequence Diagram from Java

Download PDF

Instant Reverse is a process to produce UML class model from a given input of source code. With instant reverse, you can reverse a snap shot of your code-base to UML classes and form class diagram in further. Instant reverse can read the code body of operation in Java class (source file), analyze the method invocations and form the result on a sequence diagram. This allows you to study the runtime behavior of your application by means of a sequence diagram, which makes it easier to locate potential bottleneck and carry out changes.

Reverse engineering sequence diagram from source files

  1. Select Tools > Code > Instant Reverse Java to Sequence Diagram… from the toolbar.
  2. In the Instant Reverse window, add the zip file of source or folder path of source by clicking on the appropriate Add button at the right hand side of the window. Make sure the source folders include all the source files of all classes necessary for analyzing the traces of calls.

    Note: You can reverse multiple source paths by adding them one after the other.
  3. Click Next.
  4. Select the operation you want to analyze its content and form sequence diagram.
  5. Click Next.
  6. In the Choose Diagram page, select the diagram to visualize the result. You can either form a new sequence diagram by selecting Create new sequence diagram and entering the diagram name or select Select an existing sequence diagram and choose an existing sequence diagram to visualize the result.
  7. Click Finish. When the process is completed, you can obtain the result in sequence diagram.
    Sequence diagram formed

Reversing deeper level of code details

Instant reverse does not drill inside method calls indefinitely. Instead, it reverse just the operation selected. If you want to reverse deeper level of details, right click on the target sequence message and select Instant Reverse Java Source from the popup menu.
Reverse Java source with a sequence message