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.

June 24, 2015
Views: 70,120
PDF Download

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

  1. Download Department-Store.vpp. You can also find this file at the bottom of this tutorial, under the Resources section.
  2. Open the downloaded project file in Visual Paradigm. You can find the following Class Diagrams in the project:
    class diagrams
    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.
  3. To create a Matrix Diagram, select Modeling > Impact Analysis > Matrix from the application toolbar.
  4. 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.
    add class to row
  5. Similarly, select Class and click > to add it to Models on Column.
    class added to column
  6. Select Relationship from the drop-down menu of By. This means that a matrix will be formed by analyzing the relationships among classes.
    by relationship
  7. Let's say we want to specifically view the associations among classes. Beside the drop-down menu of Relationship, select Association.
    select association
  8. Click OK to form a matrix. Here is the matrix formed:
    matrix diagram formed
  9. 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.
    show association of class
  10. 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.
    change to generalization
    The matrix is updated to present the generalization relationships among classes.
    matrix diagram updated
  11. 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.
    show view of class
  12. In the Show View window, select Inventory from the list of diagrams and then click on Go to View at the bottom right corner.
    open view
    This opens the Inventory diagram with the RefundReport class selected.
    view opened

Exporting a Matrix Diagram to Excel

You can also export a Matrix Diagram to an Excel file. To export a matrix:

  1. Click on the Export to Excel button at the top right of the matrix.
    export matrix to excel
  2. Enter the filename in the file chooser and confirm. The result should look like this:
    matrix diagram formed