Working with the Dependency Structure Matrix (DSM)#

The Dependency Structure Matrix (DSM) is one of the primary ways to visualize a project within Lattix Architect. It displays the system organization in the form of a matrix. It is highly scalable and the problematic dependencies are easy to identify. It’s a neutral representation making it useful for displaying many kinds of architectural data.

Creating a DSM#

  • On Project Home click on the New Dependency Structure Matrix link. A new DSM is created with $root as the outermost container.

  • Select a subsystem in the Navigator, right click and select the New Dependency Structure Matrix menu item. A new DSM is created with the selected subsystem as the outermost container.

  • Select a subsystem in a DSM or CAD, right click and select New View –> New Dependency Structure Matrix menu item. A new DSM is created with the selected subsystem as the outermost container.

Configuring Cell Identity Style#

Select the identity style by View –> Dependency Options –> Identity Style and choosing the appropriate menu item. There are three alternatives:

  1. Percent: You can display the size of the subsystem, measured as a percentage of the number of atoms in the subsystem to the total number of atoms in the loaded system.

  2. Strength: You can display the dependency strength of the coupling within the system.

  3. None: The diagonal cell is marked with a ‘.’. This is the original DSM style.

Understanding the Dependency Structure Matrix (DSM)#

image0

The DSM is displayed in the middle pane. The x-axis and the y-axis of the DSM are the subsystems which compose the system. The rectangle in the upper left represents the system currently being viewed. In this case, we are looking at the entire system which is called the System Root or $root. $root contains the subsystem org.apache.tools. The org.apache.tools subsystem is in turn composed of four subsystems: org.apache.tools.ant, org.apache.tools.mail, org.apache.tools.tar and org.apache.tools.zip. You can expand any of the subsystems by clicking on the expand icon ‘+’ next to the subsystem name. When a subsystem is expanded, the subsystem name is turned on its side and its children are displayed in the grid (Preferences gives you settings for other display options). This ability to display hierarchy is one of the reasons why DSMs scale so effectively.

Note that Lattix Architect displays shorter names for convenience. To display the full name of a subsystem you just need to bring your mouse over the subsystem to view a tool tip with the full name, or select the subsystem and the full name will be displayed in the Information pane. You can also drag the border between the subsystem names and the matrix to the right, which expands the row names.

The DSM depicts the dependencies between the various subsystems. By default the strength of a dependency is calculated by aggregating the dependency of leaf elements within a column name on the leaf elements within a row name. If member level analysis is enabled, the leaf level for language modules will generally go down to the method or data members. If member analysis is not enabled, the leaf level will be a file or a class for language modules. Member level analysis is further explained here.

Manipulating the DSM#

Editing the DSM#

The goal of architecture discovery is to reorganize the DSM to reflect the actual architecture. You can change the hierarchy in any way you wish: you can move elements from one place of the hierarchy to another; you can create additional structure within the hierarchy; you can delete the current structure; and you can rename elements.

Lattix Architect is an editor with the ability to Undo and Redo any of the edits. All changes you make are remembered in the Work List branch of the Navigator and can be exported to a variety of formats through Report –> Project Report.

image1

In order to operate on a subsystem or a group of subsystems, select it and right click to bring up the context sensitive pop-up menu and choose Edit. Optionally, you can pull down the Edit Menu from the Menu Bar. Many of the common operations can also be selected directly from the icons on the Tool Bar.

The DSM is recomputed every time you edit the hierarchy (the Calculator icon at the right of the tool bar allows you to turn off the recomputation). The following are some of the operations that are available.

Cut Subsystem: Mark selected subsystem(s) to be cut.

Paste Subsystem: Paste the cut subsystem(s) next to the selected subsystem. The cut subsystems are pasted at the same level of the hierarchy as the selected subsystem. The cut subsystems are placed sequentially next to the selected subsystem.

Paste Into Subsystem: Paste the cut subsystem(s) into the selected subsystem. The cut subsystems are inserted into the selected subsystem. As a result, the selected subsystem now becomes the new parent of the cut subsystem.

Create Subsystem: Create a subsystem at the same level of the hierarchy as the selected subsystem. The new subsystem is created sequentially next to the selected subsystem.

Create Subsystem in: Create a subsystem within the selected subsystem. The selected subsystem becomes a parent of the newly created subsystem.

Create Parent Subsystem for: A new subsystem is created and the selected subsystems are made the children of this newly created subsystem.

Edit Subsystem: Change the name of the subsystem and change any properties associated with the subsystem.

Delete Subsystem: The selected subsystems are deleted. The entire tree of subsystems is deleted.

Delete Subsystem retain children: The selected subsystem is deleted while retaining all its children. The children are moved up the hierarchy - they are now at the same level as their deleted parent.

In addition Move Up and Move Down allow the selected subsystem to be moved up or down.

Drag-n-Drop#

The usage model for drag and drop is similar to Excel. Select the subsystem to be moved. Move your cursor within that subsystem close to the top or bottom boundary. You will see the cursor change to a move icon. Keeping the left mouse button pressed drag the subsystem to where you want to insert it. As you drag it, you can put it between two subsystems when the boundary between those two subsystems is highlighted. You can insert it into a subsystem when the entire boundary of a subsystem is highlighted.

Applying Algorithms within a DSM#

Lattix Architect provides a rich set of algorithms for architecture discovery and management. They help identify layering and componentization within the software system even after architectural intent has eroded. Large systems can be analyzed quickly by applying many of these algorithms and coupling them with an understanding of the software system being analyzed.

In order to apply a partitioning algorithm:

  • Select a subsystem.

  • Pull down the appropriate algorithm to apply from the partitioning icon on the toolbar.

image2

The results of the partitioning algorithms are displayed as square boxes (called virtual partitions) within the DSM. Here is an example of how the results of the Component and Reachability Partitioner are displayed within the DSM:

image3

Here partitioning helps determine: