Project Analyzer Enterprise Diagrams

Enterprise Edition only

Visualize the structure of your system with Enterprise Diagrams. Reverse engineer your software back to design models. Understand legacy systems. Perform impact analyses. Detect bad design. Plan restructuring efforts. Start Enterprise Diagrams in the Enterprise menu of Project Analyzer.

File dependencies. This diagram shows file requires/is required by information. A→B means file A requires file B to compile or run. A red double-headed arrow indicates mutually dependent files, which should be avoided if possible.

File dependency diagram, PicInfo sample

File dependencies, circular groups boxed. This file dependency diagram emphasizes circular dependency groups. The groups are based on File dependency analysis. Consider removing the circular dependencies to reach better reusability.

File dependency diagram, circular groups boxed, PicInfo sample

File dependencies, circular groups collapsed. Save space by collapsing circular dependency groups. The groups are frequently very complex inside, making them hard to visualize. This option hides the circular dependencies in effort to make the diagram easier to read.

To see the hidden links inside the groups, get the circular groups boxed diagram for each group.

File dependency diagram, circular groups boxed, PicInfo sample

Inherits and Implements. This option builds a full class hierarchy diagram with interfaces. Not all projects use inheritance or interfaces. Therefore, the diagram may consist of separated classes only. For classic VB projects the diagram displays only Implements since there is no Inherits available.

Inherits and Implements diagram, PicInfo sample

Control flow. This diagram shows how procedure execution traverses between modules. It is the equivalent of a procedure call diagram taken to the module level.

Module control flow diagram, PicInfo sample

Data flow. This diagram shows all data flows between modules. Data flows via variable read/write, procedure parameters and function return values. It is typical that data flows in both directions between 2 modules as the modules pass data via parameters and return values.

Direction of data flow
Variable readreader←variable
Variable writewriter→variable
Procedure call, "in" paramcaller→destination
Procedure call, "out" paramcaller←destination
Function return valuecaller←destination
Module data flow diagram, PicInfo sample

Variable data flow. This diagram shows data flows between modules via variable read/write. The difference to the Data flow diagram is that procedure calls and return values are not taken into account. Thus, this diagram considers only direct variable based data transfer.

Direction of variable data flow
Variable readreader←variable
Variable writewriter→variable
Variable data flow diagram, PicInfo sample

PicForm reads a variable from PicMain. The data flows from PicMain to PicForm.

Variable access. This diagram shows direct variable access between modules. The only difference to the Variable data flow diagram is the direction of the read access. This diagram is useful for reviewing access to global variables and data structures. Direct variable access is often considered bad. Instead of direct variable access, one should access data via properties or functions. This diagram reveals the direct variable access that could be rewritten.

Direction of variable access
Variable readreader→variable
Variable writewriter→variable
Variable access diagram, PicInfo sample

PicForm reads a variable from PicMain.
The direction of access is from PicForm to PicMain.

Instantiate. This diagram shows where classes are being instantiated.

Instantiate diagram, PicInfo sample
PicForm instantiates 2 classes.

Data declarations. This diagram shows where classes, structures, interfaces and forms are being used as data types.

Data declarations diagram, PicInfo sample
PicForm declares 3 data types.

Form.Show order. This diagram type describes the order in which forms show other forms by calling Form.Show (or Form.ShowDialog in VB.NET). Form1 shows Form2 if it either calls Form2.Show, or the procedure call trees starting at Form1 contain a call to Form2.Show. Form1 may also show Form2 if Form1 contains a UserControl that shows Form2. This graph does not include self-showing forms. A self-showing form is one that displays itself in its constructor or event such as Form_Load. Showing forms by setting their Visible property to True is not included in this graph.

Form.Show diagram, VisData sample

Procedure calls. The procedure call diagrams display all calls between the selected procedures.

Procedure call diagram, PicInfo sample

(click the image for a larger view)

Procedure calls, grouped by module. View calls between modules and inside them.

Procedure call diagram, grouped by module, PicInfo sample

(click the image for a larger view)

Procedure calls, cross-module only. Only calls between modules are displayed. Intra-module calls are hidden. Document cross-module calls and calls to public interfaces, leave out internal details.

Procedure call diagram, cross-module only, PicInfo sample

(click the image for a larger view)

Project dependencies. This diagram shows dependencies between several projects. It is useful with a multi-project analysis.

Project dependencies diagram, Coffee sample

File belongs to project. This option lets you view which files belong to which project in a multi-project analysis. Remember to select the project file(s) into the diagram, otherwise there are no links.

File belongs to project diagram, PicInfo sample

Cohesion. The Cohesion diagram displays the procedures of a module and also the variables they use in that same module. The diagram lets you understanding the procedure-to-procedure and procedure-to-variable relationships within a single module.

The Cohesion diagram uses the same analysis as the LCOM4 cohesion metric. The module is split into related groups based on procedure calls and variables shared. The more groups, the less cohesion. The LCOM4 value [1], [2] etc. is displayed next to each module. Even though LCOM4 is a class metric and less useful for standard modules, forms or Structures, Cohesion diagrams are available for all module types.

Cohesion diagram, PicInfo sample

Recursion. The Recursion diagram helps find indirect recursion. Indirect recursion means procedure A calls another procedure which ultimately calls A again.

While recursion is a perfectly valid program design, unintentional or ill-defined recursion can lead to an infinite loop, stack overflow or slow performance. Recursion looks like a red two-way arrow or a call circle. The number of recursive procedures is displayed as [2], [3] etc.

Recursion diagrams do not consider direct recursion where a procedure calls itself directly.

Recursion diagram, sample
A and B are mutually recursive. D, E and F form a call circle.

How to use

Enterprise Diagrams dialog

Available items. This list contains everything that is not (yet) included in the diagram.

Press either > or >> to add items to the diagram. You can also press Insert or Ctrl+Insert, respectively.

You can drag & drop selected items between the lists. Several keyboard shortcuts are available as well.

Press Find... to locate available items.

Diagram items. This list contains what will appear in the diagram. All links between these items will be included automatically.

Press < or Delete to remove selected items from the diagram. To clear the entire list, press << or Ctrl+Delete. Press Shift+Delete to remove everything but the currently selected item(s).

Cross-project links only appears when analyzing multiple projects. Select it to display links between projects and to leave out internal details.

Find links. To add more linked items to the diagram, select one or more items in the Diagram items list and press "From", "To" or Both. This will search for new items that are not listed yet, but that are linked to the selected item(s). In the example, the user has searched for 1 level of links starting with PicBMP.

Press either < or << to add the linked items to the diagram.

Via Find links you add levels to a call diagram, for example.

The two large buttons help you adjust the diagram items.

Clean unconnectedRemove unlinked items from the Diagram items list. This reduces diagram pollution.
Join selectedJoin selected items (2 or more). Simplify the diagram by joining linked items into one.

Once you're done with the selections, press one of the buttons at the bottom:

ViewCreate and view a diagram.
Save...Create diagram and save to a file.
Print...Create diagram and display Print Preview.
VisioCreate diagram in Microsoft Visio.

Recommendations

Visio diagramming

Requires Microsoft Visio (any edition) installed on the same computer. Compatibility tested with Visio 2003, 2007, 2010, 2013, 2016 and 2019.

You can use Enterprise Diagrams to produce Visio diagrams. The selected diagram structure will be sent to Visio, which will give it a layout. You can edit the diagram in Visio, add comments, rearrange and delete parts of it.

The Visio diagrams are built using the EntDiag1.vst template file. The file must be in your Project Analyzer directory. You can edit the file to tune the diagrams to your own tastes. As an example, you can change the shapes or their colors. Keep the shape names unchanged as they are used by Enterprise Diagrams.

Tip: The various layout options in Visio may prove useful. Experiment to find the best layout for your project.

Diagram save formats

You can save the diagrams in several file formats.

Diagramming tasks

Who calls function A?
Select the Procedure calls diagram type. Drag function A to the Diagram items list. Select function A. Select Indefinite levels and press the "From" button. Add the found procedures by pressing <<, then press Draw. The result is a diagram showing all callers of function A, recursively.
What happens in response to Event MyClass.Click?
Select the Procedure calls diagram type. Drag MyClass.Click to the Diagram items list. Select MyClass.Click. Press the "To" button. Add the found procedures by pressing <<, then press Draw. The result is a forward call tree from MyClass.Click.
Diagram the forms of a program
Select the Form.Show order diagram type. Press >> to add all forms to the diagram, then press Draw.
Get a complete class hierarchy diagram
Select the Inherits and Implements diagram type. Press >> to add all classes. Press Clean unconnected and then Draw.
Who implements IMyInterface?
Select the Inherits and Implements diagram type. Drag IMyInterface to the Diagram items list. Select 1 level or Indefinite levels and press the "To" button. Add the found classes by pressing <<, then press Draw.
Understand the internal structure of a class
Select the Cohesion diagram type. A list of classes appears. Select the class you are interested in, press >>, then Draw. The diagram shows connections between the class's procedures and variables.
Locate classes to split
Select the Cohesion diagram type. A list of classes appears. Classes with a count of [2] or more are candidates for splitting. Select one, press >>, then Draw. The diagram suggests how to split the class.
Locate unintentional recursion
Select the Recursion diagram type. Recursive procedure groups will be listed. Select one of the recursive groups and press >>, then Draw. If the list is empty, there is no indirect recursion in your program.

Legend

Enterprise Diagrams legend

Limitations

Don't expect miracles! No diagramming solution can visualize a large complex system on a single sheet. The best diagrams are ones with less than 100 nodes. That means less than 100 files, modules or procedures, depending on which diagram type you want. There is no way we can fit all your 2000 procedures in a diagram while keeping it readable.

The more nodes and links there are, the less readable the diagram usually gets. Rather than charting the entire system, it is often a better idea to make several smaller charts.

Too big a diagram

File dependency diagram of a 70,000-line program (138 nodes, 470 links)

The monster diagram above is technically correct, yet totally unreadable. The program is complex but relatively well-structured. It is not overly large, only 70,000 lines. No matter what layout you use and how deep you zoom, you cannot read such a big graph. Instead of the big diagram, one would need to make several sub-diagrams, possibly by utilizing the Subsystem report.

Differences to Project Graph

Project Graph produces diagrams using a different approach. It is suitable for tree-format diagramming: links from the current node forward or backward. Enterprise Diagrams takes all links into account: all links to all directions from all nodes in the diagram. This makes the Enterprise Diagrams more complex but also more informative, covering all the information available.

Differences between Project Graph and Enterprise Diagrams
  Project Graph Enterprise Diagrams
Type Interactive tree Complex network
Output Image, print-out Image, print-out, Visio diagram
Graph types available
File dependencies Yes Yes: All, circular groups boxed or collapsed
Procedure calls Yes Yes: All, grouped by module, cross-module only
Inherits and Implements Yes Yes
Control flow Yes Yes
Data flow Yes Yes: All data flows, variable data flow
Variable access no Yes
Instantiate Yes Yes
Data declarations Yes (instantiation colored) Yes
Form.Show order Yes Yes
Project dependencies Yes (limited capability) Yes
File belongs to project no Yes
Cohesion no Yes
Recursion no Yes

Troubleshooting

If you experience an error every time you try to create a diagram, run Config.exe in your Project Analyzer directory.

See also

Shortcuts

© Project Analyzer Help