Okay, so it’s been a LONG time since I’ve posted, but two small kids and a job (okay, mostly the kids) will do that. Anyway …
We’re preparing to upgrade to PowerDesigner 15.3 (sadly from 15.0) and one of the new features I’m very excited to get my hands on is the new advanced display controls available. Previously, you were fairly limited to the information you could display on a diagram. Each symbol gave you the ability to select among the most common attributes. You could add the Stereotype which gave you access to a bit of free-form text you could add to the display, but each object only had one stereotype and it lead to a lot of abuse of the stereotype concept. If you wanted to show additional information, you were often stuck with color-coding, changing the borders or adding other bits of graphical “flair” to the diagram. Not the most elegant solution and it requires the addition of a legend to all you diagrams in order to be meaningful. Forget the legend, and you’ve lost the meaning.
Well, 15.3 fixes that for us. Let’s look at a quick sample.
Let’s suppose we’d like to add some additional information to the model. I’ll add two attributes, one is the standard attribute “Annotated” which I’ll add so that our modelers know when someone else on the team has left them some useful information. The other is subject area, which we currently indicate using color coding (still handy for quickly visualizing a large model). Let’s walk through how it’s done. For this sample, I’ve already created a simple model with an extended attribute SubjectArea on the table metaclass. If you want to play along at home, I’ll leave it to you to create that. Using a criteria and custom format, I have color coded them according to standards. If I want to indicate whether there’s an annotation, I could change the width or style of the border or add a graphical tag somewhere on the object (and hope it doesn’t cover something else).
Here’s the “before” picture with the red and blue colors indicating the subject areas.
Now, let’s look at how we can do it better.
First, right click on the desktop and choose “Display Preferences…”
Now, select table on the left of the dialog and then “Advanced…” on the right.
From this dialog, you can add ANY attribute available in the model, including extended attributes you’ve added and any available in the model from another source such as the XDB file. To add SubjectArea, choose “Add Attribute” from the toolbar at the top of the dialog. Scroll down until you see “Annotated”. Since annotated is a boolean, you’ll have the ability to set a few options. Label, will actually be the label you’ll see next to the attribute on the Display Preferences dialog, NOT what you’ll see next to the value on the diagram. If you leave it blank, you’ll get the attribute name. For a boolean you have to provide a value to display when true, and a value for false. In my example, I’ve left the value for False blank, which means you won’t see anything on the diagram if the Annotated value is false.
Now, let’s add SubjectArea. Go back to “Add Attribute” and choose the “Extended Attributes” tab this time. Select SubjectArea and click “OK”. Subject area is a text string, so you’ll have a slightly different set of options. Since I created a label on the extended attribute, I can leave the label property blank here, or I can change it. Prefix and Suffix are the values that will appear before and after the actual subject area (think “<<” and “>>” for a Stereotype).
In Prefix, type a nice label such as “Subject Area: “. Don’t forget the colon and a space or two, it won’t add them in for you. Click “OK”. Now you’ll be back at the display preferences dialog and you’ll see two new options you can choose.
Make sure they’re both selected and click “OK” again. Apply your new format to all symbols and here’s the new diagram (I’ve removed the color coding, although it might be useful to keep it for a larger diagram).
Now, on any diagram, I can easily see if there’s an annotation that I might want to read and the subject area. If I print a subset of the diagram or forget to include the legend, I can still interpret it. Most importantly, I can present a LOT more information on the diagram in a format that’s much more easily understood. If you want to get really information dense, you can create extended attributes that compute a result and add that. Here’s an example. Suppose you want all your tables to have a subject area and definition set. Create a custom computed attribute.
Function %Get%(obj) %Get% = true if obj.Comment = "" then %Get% = false elseif obj.GetExtendedAttribute("Local Extensions.SubjectArea") = "" then %Get% = false end if End Function
Now add that extended attribute to the table. In this case, we’ll add it to the top of the table and set the value for False to “Model Incomplete!”. Here’s what our sample model looks like now. While this won’t replace custom checks, it’s a way to provide immediate visual feedback to all our modelers as they’re completing the models.
So, if you haven’t upgraded to 15.3 yet, here’s another great reason to keep current.