Update on UML modeling features in IBM Rational Software Architect Version 8.0: Part 1. Modeling perspective, properties, navigation, and diagramming enhancements

This article highlights some of the new functionality in the UML modeling components of IBM® Rational® Software Architect Version 8.0 and explains how to take advantage of several recently added features. The first article in the series describes the redesigned Modeling perspective, the new Properties pop-up window, simplified navigation inside models, and diagram enhancements.

Wayne Diu, Software developer, IBM Canada

Wayne DiuWayne Diu is an IBM Rational software developer. He has designed and implemented Unified Modeling Language (UML) features on the Rational Modeling Platform, such as server integration and model search. In addition, Wayne was one of the developers responsible for establishing the metamodel integration framework platform. Wayne has also developed a diverse collection of other tool features such as printing, validation marker enhancements, and refactoring support.


developerWorks Contributing author
        level

09 November 2010

Also available in Chinese Japanese Portuguese

Enhancements to the UML Modeler component

As of IBM® Rational® Software Architect Standard Edition Version 8, IBM® Rational® Software Modeler is included as a component called UML Modeler. Thus, what was two products is now only one. This provides BPMN 2 (Business Process Modeling Notation), UML 2 (Unified Modeling Language) modeling, code visualization, and reconciled modeling support for Java™, C#, and VB.NET (Microsoft® Visual Basic® .NET). You can augment this foundation platform with a set of optional extensions that provide capabilities from collaboration and simulation through to deployment modeling or the use of integrated architecture frameworks. IBM® Rational® Software Modeler users benefit from this change, because you now get the code visualization and round-trip engineering capabilities as part of your move to Rational Software Architect Version 8.

This article describes many of the enhancements included in the UML Modeler component to help you create clearer diagrams, prevent or resolve problems, and collaborate with colleagues.


Cleaner, more convenient views

As part of this significant change, the Modeling perspective has been improved.

Modeling perspective

If you start from a new workspace or reset your perspective (from Window > Reset Perspective), you will no doubt recognize that the default Modeling perspective has changed in IBM Rational Software Architect Version 8.0. By default, the Modeling perspective contains only four views:

  • Project Explorer
  • Layers (new)
  • Outline
  • Properties

The rest of the views (such as the Inheritance Explorer) are available as Fast Views by clicking the Fast View button at the bottom-left of the application window.

The previous perspective has been renamed to Classic Modeling. It remains only for compatibility purposes, so it is better to use the new one.

Properties

Although the classic Properties view is still supported, a more convenient kind of view is now available in the form of a pop-up dialog window, shown in Figure 1. It gives you easy access to the properties of selected elements without taking up a large portion of the screen. To access the new view, select Properties from the element's context menu from either the Project Explorer or the diagram.

In the example in Figure 1, the General properties for the selected element (Central System::Main) are shown. To show other properties of the element, use the left or right arrows in the title bar to switch property pages. The down arrow (next to "General") displays a list of the property pages that are available for the selected element, which corresponds to the property tabs available in the classic Properties view.

Figure 1. Showing the properties of an element from the Project Explorer
The Properties pop-up window

Larger view of Figure 1.

Properties and simplified navigation

You can also access the Properties pop-up window by using clickable hyperlinks that simplify navigation. Hovering your cursor over the names of elements in diagrams will display a pop-up tip with one or more hyperlinks (see Figure 2). Clicking the hyperlink will show the properties of that element. Hovering over attributes will display a link to both the attribute itself and the type of the attribute (if a type has been set). Hovering over operations will display a link to the operation and each of its parameters. In addition, some tables contain columns where you can select a type. Cells in those columns contain a button labelled with a right-facing arrow ->. You can also access the properties in the pop-up window by pressing that arrow button; from there, you can jump to the properties of the type that you have selected.

Figure 2. Hyperlinks appear in a pop-up tool tip
Diagram with hyperlink tip

Larger view of Figure 2.

In addition to simplifying navigation to the properties of elements, navigation to the element in the Project Explorer has also been improved. Apart from being able to navigate to the primary element, it is also possible to navigate to certain referenced elements. As in previous versions of the software, you locate the element in the Project Explorer by using the Navigate submenu of the element's context menu or drop-down menu. In sequence diagrams, if you select a lifeline on the diagram, in addition to being able to navigate to the corresponding lifeline in the Project Explorer, you can navigate to the chosen lifeline's property or type. For a Behavior Execution Specification, you can navigate to the referenced behavior. On activity diagrams, you can also navigate to the referenced element for elements, such as the Send Signal action (which references a signal) and the Call Behavior operation (which references a behavior).

You can use the arrow button in the Properties toolbar to navigate to the element in the Project Explorer, while the arrow button in the cell of the Type column (Figure 3) can be used to navigate to the properties of the type.

Figure 3. The Attributes property page
Arrow is selected for the resolution element type

Larger view of Figure 3.

You can programmatically extend this hyperlink functionality by implementing the public ILinkProvider and INavigationProvider interfaces in com.ibm.xtools.rmp.ui.


Diagram enhancements

Diagramming features are now easier to use, and many enhancements make the diagrams more aesthetically pleasing and clearer.

Themes

It is frequently desirable to apply a certain formatting style to shapes and connectors on diagrams. To support this, the UML Modeler feature now uses the concept of themes: reusable styles that can be automatically applied onto shapes and connectors. Existing shapes and connectors can have styles individually applied onto them. Thus, it is possible to apply different themes to different elements in the diagram.

The UML Modeler includes 10 predefined themes, and you can customize them to create your own version. To create your own themes, or to select the default theme:

  1. From the Preferences view (from the Window menu, click Preferences), select Modeling and then Appearance.
  2. In the Appearance pane, you will find a list of all the default themes, along with any themes that you added. At the end of that list of themes, you can select the New option to create a new theme (see Figure 4).
Figure 4. The Appearance pane in the Preferences view
The Preferences window

To add a new theme, select the Add item or the Details button. New themes are created by customizing an existing theme. Therefore, when the Theme Details window appears, it displays the details of an existing theme.

Figure 5. The Theme Details view displays the details of an existing theme
Columns: Appearance, Element Type, Palette Drawer

The element types listed in each row of the Theme Details view are the types for which a specific style has been applied. The buttons at the bottom pertain to the overall theme, while the buttons on the right pertain to adding and deleting styles for a particular theme. Thus, for example, the Delete button on the right pertains to deleting the appearance associated with an element type, while the Delete button at the bottom is used to delete the entire theme currently displayed.

  1. To customize the styles for additional element types not yet defined by the current theme, follow these steps:
  2. Click the Add button on the right. This brings up the Element Types wizard.
  3. Select the element types that should be given a particular appearance. It's a good idea to select only shapes and connectors that should be given the same appearance, or style.

After selecting the element types and clicking the Next button, you are prompted to select an existing appearance to apply to the element types that you checked. There are 48 default shapes and 12 default connectors to choose from, and you can add your own.

  1. To customize the appearance, choose the last item in the list: New.
  2. When either the Shape Appearance Details or Connector Appearance Details window appears, you can choose the details for your shape or connector.
  3. Be sure to click the Save As button at the bottom of the screen to save your customized appearance.
Figure 6. Use the Element Types wizard to choose the appearance for shapes and connectors
The Element Types view, Default connector selected

Larger view of Figure 6.

You can repeat the process for additional element types and choose different appearances for them. (Again, it is a good idea to select only shapes and connectors that should be given the same appearance style, and then continue repeating the process.)

To adjust the appearances for individual element types after they have been added, you have two options.

  • The first is to select the element type from the Theme Details options, and then click Delete and re-add it using the Add button.
  • The other is to select the element type and click the ellipses (…) button that appears. This will show a drop-down menu with all of the default appearances, as well as any that you defined.

Applying themes to diagram elements

If you want to apply a specific appearance to a diagram element, you can do so in one of two ways.

  1. Select the element and show its properties, either by choosing Properties from the element's context menu (by right-clicking the element) or by showing the classic Properties view. Next, choose the Appearance page from the properties and, in the Select an existing appearance drop-down menu, choose the theme that you want to apply to the shape or connector.
  2. Show the shape's context menu and choose the Appearance menu item. The Shape Appearance Details dialog window will appear. From there, you can make customizations before applying the appearance.
Figure 7. Choose the gradient from the Shape Appearance Details window
The Gradient Selection pop-up view

Larger view of Figure 7.

Customizing shapes further

While working with themes, you probably will have noticed many more appearance options to choose from. For shapes, these include transparency, improved gradients, and more control over line widths. Also, the individual compartments in a shape now support the shape's border style. For connectors, these include rounded corners and line attributes, including a choice of line widths, line types, and arrow types.

Further customization of the shapes is available from within the Appearance property tab. Setting the line thickness is done from Use the Line width drop-down menu in the Border group to set the line thickness, and choose a gradient fill by using the Fill color drop-down menu in the Fill group.

Figure 8 shows a class overlapping an actor. Being able to set the transparency is particularly useful when you have shapes overlapping other shapes.

Figure 8. A class overlapping an actor
A diagram and a properties selection window

Larger view of Figure 8.

Note:
To follow the UML specification, not all line parameters are configurable for UML connectors. For example, it would not make sense to be able to represent an association by using a dashed line. To take advantage of the line enhancements on your diagram, use the Line palette item in the Geometric Shapes palette drawer. This way, you can draw freeform lines not bound by UML constraints.

Saving a diagram element's appearance

After you are satisfied with the ways that you have customized your shape or connector, you might wish to preserve the appearance so that it can easily be applied to other shapes or connectors.

  1. To capture a shape or connector's appearance, select the shape or connector and right-click to show the context menu of the shape and choose Add to Appearances.
  2. Next, type in the name of the appearance.

The appearance is saved and can now be reused.

Figure 9. Use Add to Appearances to save a diagram element's appearance
The diagram's context menu

Larger view of Figure 9.

Diagram feedback

When drawing connectors from one shape to another, it might not be obvious which shape was the source or the target. This is particularly true on a crowded diagram with many shapes. Now, however, the target shape is highlighted, making it absolutely clear where the connector target is.

Similarly, when clicking the connector, the label is highlighted. This makes it obvious which label belongs to which connector. This is particularly helpful when many connectors are close together.

In addition, it could be unclear why the connector might not have been created as you expected it to be. An explanation box appears to describe why it's not possible to create the connector. The example in Figure 10 shows an attempt to create a package import from one class to another class. Of course, this is not possible, because the target end of the import must be a package.

Figure 10. A message explains why a package import cannot be created
A small tool tip on a shape

Larger view of Figure 10.

It is possible to adjust the settings, including what type of messages should be displayed, and the delay before the message should be displayed. To do so, show the Preferences dialog and choose Modeling > Appearance >Feedback.

Documentation tool tip

If you hover your mouse cursor over a diagram element, a tool tip from the documentation for that element will pop up. (This is similar to how Javadoc shows up when you hover over a method in a Java™ file in Eclipse.) In addition, it offers hyperlinks to the relevant element and its parents, if any.

Figure 11. A tool tip about a diagram element
A tool tip that contains documentation

Larger view of Figure 11.

To control the tool tip settings, such as transparency and delay, use the Modeling > General preference page.

Figure 12. General Preferences page settings to control the appearance of tool tips
The General dialog window within Preferences

Rich text support

Rich text support has been improved again to make it more stable. Also, rich text is now fully supported on notes and comments. In addition to being able to edit the documentation of an element by using rich text, you can now edit the actual content of the note or the comment using rich text.

Figure 13. Editing a comment in rich text
The rich text pop-up box

Larger view of Figure 13.

Preferences have been added to control the rich text, too. The most significant is the ability to alter the default font settings. This enables you to make the text in your diagrams consistent, for a better appearance, without having to change the settings every time that you create rich text. To see other text-related settings, show the Preferences dialog and select Modeling > Text.

Figure 14. Rich text preferences
The Text pane within the Preferences view

Layers

A diagram can be simplified if only the elements that you're interested in are shown and the rest of the diagram is hidden. For example, you might want to show only the external parts of a system for an application. To do this, separate the shapes that represent the internal classes onto a separate layer, and then hide the layer to instantly simplify your diagram.

If you had existing diagrams, or if you do not explicitly work with layers, all of the shapes on the diagram are placed on the default layer. This layer cannot be deleted or hidden, and it is not shown in the Layers view.

Figure 15. The Layers view appears in the bottom-left corner by default
A sequence diagram showing only one layer

Larger view of Figure 15.

As mentioned previously, the Layers view is shown by default in the Modeling perspective. All of the layers (except the default layer) are controlled through that view. To add a layer, click the green plus button in the view. (If you have not already added any layers to the diagram, you can also use the Click here to add a new layer to the diagram hyperlink.)

You can activate a layer by selecting it in the Layers view. An active layer is highlighted in the view. When a layer is active, new shapes and connectors that you create on the diagram are automatically added to the layer. To add existing shapes and connectors to the layer, select the diagram elements and click the Add diagram elements to layer button in the Layers view.

The three boxes located on the left of each layer in the Layers view are used to control (from left to right) visibility of the layer, locking the layer, and selection. If the layer is visible, an eye appears in the left-most box. Clicking the box hides the layer.

Note:
When a layer is hidden, the connectors that connect shapes inside the layer to shapes outside the layer are also hidden. This prevents connecting a shape to nothing.

The middle box toggles between locking and unlocking a layer. If a layer is locked, it cannot be edited on the diagram, although shapes on locked layers will be updated when there are changes in the model. For example, if the shape's underlying element is a class and the class is renamed, the name in the diagram element will update automatically. Similarly, if the class is deleted, the diagram element will also be deleted.

Lastly, the box on the right is used both to select elements and to indicate whether elements on the diagram have been selected. Clicking the selection box will select all of the elements in the layer on the diagram. Likewise, if an element belonging to a layer is selected on the diagram, the selection box will show a cursor with a circle. You can also double-click on a layer to select all of the elements in the layer.

Tip:
On crowded diagrams where shapes overlap, it is also useful to be able to quickly rearrange the order of which shapes appear in front of other shapes. When shapes are placed into layers, the top-most layers appear at the front of the diagram, while the bottom-most layers appear at the bottom of the diagram. If you subsequently specify ordering using Format > Order from the context menu, that will be respected unless you perform an operation that requires recalculating the order of the layers (such as using the Up or Down buttons to reorder the layers).

Layouts

The way that shapes are arranged on the diagram has been improved significantly. Rational Software Architect now uses the well-respected layout algorithms provided through ILOG integration. In addition to the improved layout, there are also many more layout options. You can automatically lay out all of the elements on a diagram in many predefined layout configurations with only a few clicks of your mouse.

Consider the diagram shown in Figure 16. It has only five shapes, yet I've still managed to make the connectors into an absolute mess.

Figure 16. Connectors overlap shapes in this poorly laid out diagram
Diagram example

The layout could be improved. To do this automatically, select the diagram surface and show the Properties pop-up window. Next, select the Graph Layout property page. Choose from any one of the predefined layouts, and click Apply the selected graph layout configuration. You have made the diagram far clearer without much effort!

Figure 17. Use the Graph Layout properties page to control the layout of a diagram
Graph Layout view, showing Details at right

Larger view of Figure 17.

Note:
To turn off the animation while the diagram is being laid out, show the Preferences dialog and choose Modeling > Appearance. Then, check the Optimize layouts for performance check box.


What's next

This article provided an overview of the new functionality in the UML Modeler component of Rational Software Architect Version 8.0. By taking advantage of these enhancements, you will be able to model more effectively and efficiently, with an emphasis on clearer diagrams, problem prevention and resolution, and workflows that support collaboration.

The next article in this three-part series describes other enhancements specific to UML modeling, involving these areas:

  • The Project Explorer view
  • Search
  • Model validation
  • Refactoring
  • Model fragments
  • Profiles
  • UML compliance
  • Viewpoints and active language

Acknowledgements

The author expresses his gratitude to Dusko Misic and Michael Hanner for reviewing this article and to Judith Broadhurst for editing.

Resources

Learn

Get products and technologies

Discuss

Comments

developerWorks: Sign in

Required fields are indicated with an asterisk (*).


Need an IBM ID?
Forgot your IBM ID?


Forgot your password?
Change your password

By clicking Submit, you agree to the developerWorks terms of use.

 


The first time you sign into developerWorks, a profile is created for you. Information in your profile (your name, country/region, and company name) is displayed to the public and will accompany any content you post, unless you opt to hide your company name. You may update your IBM account at any time.

All information submitted is secure.

Choose your display name



The first time you sign in to developerWorks, a profile is created for you, so you need to choose a display name. Your display name accompanies the content you post on developerWorks.

Please choose a display name between 3-31 characters. Your display name must be unique in the developerWorks community and should not be your email address for privacy reasons.

Required fields are indicated with an asterisk (*).

(Must be between 3 – 31 characters.)

By clicking Submit, you agree to the developerWorks terms of use.

 


All information submitted is secure.

Dig deeper into Rational software on developerWorks


static.content.url=http://www.ibm.com/developerworks/js/artrating/
SITE_ID=1
Zone=Rational
ArticleID=570342
ArticleTitle=Update on UML modeling features in IBM Rational Software Architect Version 8.0: Part 1. Modeling perspective, properties, navigation, and diagramming enhancements
publish-date=11092010