Overview of this Tutorial
In this tutorial, you will learn how to use Matrix Diagram to find out the relationships between classes in a complicated project.
In order to complete this tutorial you must have Visual Paradigm installed. You also need to have basic knowledge in UML modeling with Visual Paradigm.
Creating 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 in the project the following Class Diagrams:
The diagrams contain many classes, with some of them being visualized in multiple diagrams, and with complex relationships in between. With a project like this, it's not easy to tell the relationships of any given class. In order to this, you can make use of a Matrix Diagram.
- To create a Matrix Diagram, select Modeling > Impact Analysis > Matrix from the application toolbar.
- In order to form a matrix you need to choose the things 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 into Models on Row.
- Similarly, select Class and click > to add it into 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 view specifically 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 RefundReport class and select Show View... from the popup menu.
In the Show View window, select Inventory from the list of diagram and then click on Go to View at bottom right corner.
This opens the Inventory diagram with RefundReport class selected.
Exporting 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: