Work smarter with PowerDesigner – use a Dependency Matrix to assign Domains to Attributes
PowerDesigner’s dependency matrices are really powerful, and I don’t ever remember seeing anything similar in a data modelling tool. They allow me to visualise and even edit links between objects.
In a Conceptual, Logical, or Physical Data Model, or in a UML Object Model, Domains are a useful object, allowing you to manage the ways in which your data is represented. Take this simple data model, for instance.
I’ve reached the point where I need to assign a Domain to each attribute. I can edit each attribute one at a time, and select a Domain from the drop-down list, like this:
In a large model, that could take some time. There are a couple of ways we could speed up the process:
- edit multiple attributes at once using a list of attributes
- use a Dependency Matrix
In this blog post, I’ll cover the second option. A Dependency Matrix is a model object so, like any other model object, there are several ways of creating one. The simplest way is to right-click the model name in the Browser, then select “New”, and “Dependency Matrix”. The first thing we have to do is choose the types of objects to display in the rows and columns.
I want to use this matrix for editing attributes, so I have to make sure that the rows contain Entity Attributes, and the columns contain Domains. The matrix cell will show the “Domain” property of the Entity Attribute. When I click on <OK>, the matrix is created, and appears in the Browser
Now I can double-click the matrix to show the content
Three attributes already have the domain assigned – two of those are foreign keys for Building.Building Name, so I only had to set one of them, PowerDesigner set the other two automatically. Now, if I click inside one of the cells, such as the intersection of Elephant.Elephant Name and Animal Name, I can assign the domain to the attribute with one press of the keyboard – I use the Spacebar.
Now all I have to do is use the cursor keys to move around the matrix, and press the Spacebar every time I want to assign a Domain. It doesn’t take long to finish them all. Here’s the final matrix:
Here’s the model:
The toolbar allows me to use the matrix in flexible ways, such as choosing which attributes or domains to include, hiding ’empty’ or populated rows, and exporting to Excel. Press <F1> to find out more.