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.

1. initial model

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:

3, Assigning a Domain

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.

4. Create matrix

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

4a. browser

Now I can double-click the matrix to show the content

5. Matrix Content - initial

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.

6. instructions

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:

7. Matrix Content - final

Here’s the model:

8. final

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.

9. Toolbar


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s