How to Analyze Model Dependency with Matrix?
Matrix Diagram is a table, which shows the existence of relationships among model elements of particular types. By reading Matrix Diagram, you can tell easily whether two model elements are related or not and what kind of relationship they have.
Overview of This Tutorial
In this tutorial, you will learn how to use a Matrix Diagram to find the relationships between classes in a complicated project.
To complete this tutorial, you must have Visual Paradigm installed. You also need basic knowledge of UML modeling with Visual Paradigm.
Creating a Matrix Diagram
- Download Department-Store.vpp. You can also find this file at the bottom of this tutorial, under the Resources section.
-
Open the downloaded project file in Visual Paradigm. You can find the following Class Diagrams in the project:
The diagrams contain many classes, some of which are visualized in multiple diagrams, and with complex relationships between them. With a project like this, it's not easy to tell the relationships of any given class. To do this, you can make use of a Matrix Diagram. - To create a Matrix Diagram, select Modeling > Impact Analysis > Matrix from the application toolbar.
- To form a matrix, you need to choose the items to list on the rows and columns. In this tutorial, we want to show the relationships among classes. Therefore, we need to list classes on both rows and columns. In the list of available modes, select Class and click > to add it to Models on Row.

- Similarly, select Class and click > to add it to Models on Column.

- Select Relationship from the drop-down menu of By. This means that a matrix will be formed by analyzing the relationships among classes.

- Let's say we want to specifically view the associations among classes. Beside the drop-down menu of Relationship, select Association.

- Click OK to form a matrix. Here is the matrix formed:

- Let's say we want to check the associations of the class AdminStaff. Click on the AdminStaff row or column. You should see the cells highlighted accordingly, indicating the classes to which AdminStaff is connected.

-
Let's say you want to check the generalization relationships among classes now. At the top left corner of the matrix, change Association to Generalization from the drop-down menu of Relationship.
The matrix is updated to present the generalization relationships among classes.
- You can open the diagram in which a chosen class is being visualized. Let's try. Right-click on the RefundReport class and select Show View... from the popup menu.

-
In the Show View window, select Inventory from the list of diagrams and then click on Go to View at the bottom right corner.
This opens the Inventory diagram with the RefundReport class selected.
Exporting a Matrix Diagram to Excel
You can also export a Matrix Diagram to an Excel file. To export a matrix:
- Click on the Export to Excel button at the top right of the matrix.

- Enter the filename in the file chooser and confirm. The result should look like this:
