Sequence Diagram Views

Typically, if you're examining in the calling hierarchy of your software, the Function Calls selection from the Structure views will contain the information that you're interested in. You see all the calls between the functions you're examining. And if you're also interested in variable usage, the Function Calls with Variables shows which functions are setting and reading the variables you're studying.

However, there may be times when you want to understand the sequence and conditionality of the function calls and variable usage in your code. Visualization of this more detailed control flow analysis is available through the Sequence Diagram. In order to (1) provide information about the conditionality of symbol use and (2) support visualization of a wider scope of software in limited screen space, Imagix 4D sequence diagrams differ from the standard UML sequence diagram format.

Sequence Information

In the Sequence Diagram view, the displays are limited to functions and variables. The simple shapes representing functions (rectangles / squares) and variables (tetrahedrons / triangles) in the Structure views are replaced by larger, more complex representations. These show where, in each visible non-library function, the other visible functions are called, and where the visible variables are read and set.

The layout used in the Sequence Diagram is equivilent to the 2D Graph, with a normal / roots horizontal layout. The flow is always from left to right. The left-most column contains the roots among the symbols visible in the diagram, the next column has the roots of the remaining symbols, etc.

Within a column, the symbols are ordered top to bottom according to the order they are used among symbols in that column. Thus, the sequence of the control flow is generally from the upper left to the lower-right of the diagram.

Conditionality Information

However, this is an over simplification, because a symbol might be called multiple times and/or its use might be conditional.

To communicate this, the Sequence Diagram shows each separate use of a symbol, and the conditions that lead to that use. To support this, the function representations show the lines of source code where symbol usage (in black) occurs and the relevent decisions (in blue) that control whether a function call or variable set /read is actually reached. Each level of decision is indented, so you can quickly see any decisions leading up to the usage.

The default behavior is also to display lines of source code where function return statements occur, along with any decisions associated with reaching them.

As you modify the diagram and the set of functions and variables displayed, the internal contents displayed for each visible non-library function automatically changes. You're able to quickly, accurately examine the flow of control among the specific functions and variables you choose to view.

Managing Complexity

The Sequence Diagrams share Imagix 4D's graphic querying capabilities with the Structure and UML Class Diagrams views, so you're able to analyze the specific portions of your function and variable control flow that you're interested in. As your analysis expands, the diagrams can quickly become rather large.

One way to limit their size is to selectively collapse the function boxes, hiding the source code snippets related to those specific functions. A second is to suppress the display of return statements; this hides all the return statements, along with any decision hierarchy snippets that are specifically related. Here's the same diagram as above, with returns disabled and with source code from one of the functions hidden.