Displaying Attributes and Operations

I l @ ve RuBoard

Attributes and Operations may be displayed on a class diagram. Often, a class diagram is created specifically for this purposeit shows the structure and behavior of the classes in a package. Relationships typically are not shown on this diagram.

CREATING A CLASS DIAGRAM TO SHOW THE ATTRIBUTES AND OPERATIONS FOR A PACKAGE

graphics/quatranirose_icon.gif
  1. Right-click to select the package in the browser and make the shortcut menu visible.

  2. Select the New:Class Diagram menu choice. A class diagram called NewDiagram will be added to the browser.

  3. With the new diagram selected, enter the name of the diagram.

ADDING CLASSES TO A DIAGRAM USING THE QUERY MENU

graphics/quatranirose_icon.gif
  1. Double-click on the diagram in the browser to open the diagram.

  2. Select the Query:Add Classes menu choice.

  3. Select the desired package.

  4. Click to select the desired classes and click the >>>> button to add the classes to the diagram or click the All >> button to add all the classes to the diagram.

FILTERING RELATIONSHIPS IN RATIONAL ROSE

graphics/quatranirose_icon.gif
  1. Double-click on the diagram in the browser to open the diagram.

  2. Select the Query:Filter Relationships menu choice.

  3. Click the None button in the Type field to hide all relationships shown on the open diagram.

  4. Click the OK button to close the Relations window.

DISPLAYING SOME ATTRIBUTES OR OPERATIONS IN RATIONAL ROSE

graphics/quatranirose_icon.gif
  1. Right-click to select the class on an open class diagram and make the shortcut menu visible.

  2. Select the Options:Select Compartment Items menu choice.

  3. Click to select the attributes and operations to be displayed.

  4. Click the >>>> button.

  5. Click the OK button to close the Edit Compartment window.

SHOWING ALL ATTRIBUTES AND OPERATIONS IN RATIONAL ROSE

graphics/quatranirose_icon.gif
  1. Right-click on the class in a diagram to make the shortcut menu visible.

  2. Select the Options:Show All Attributes menu choice to display all the attributes for the class.

  3. Repeat step 1 and select the Options:Show All Operations menu choice to display all the operations for the class.

Note

To always display the attributes and operations for a class, you can set the Show All Attributes and Show All Operations selections using the Tools:Options menu.


SETTING STEREOTYPE DISPLAY IN RATIONAL ROSE

graphics/quatranirose_icon.gif
  1. Right-click on the class in a diagram to make the shortcut menu visible.

  2. Select the desired Options:Stereotype Display menu choice (None = do not display stereotype, Label = show stereotype in << >>, Icon = show class using Stereotype icon).

The class diagram called Attributes and Operations for the University Artifacts package is shown in Figure 7-6. For this type of diagram I prefer to show the stereotypes of the classes as labels.

Figure 7-6. Displaying Attributes and Operations

graphics/07fig06.jpg

I l @ ve RuBoard


Visual Modeling with Rational Rose 2002 and UML
Visual Modeling with Rational Rose 2002 and UML (3rd Edition)
ISBN: 0201729326
EAN: 2147483647
Year: 2002
Pages: 134

Similar book on Amazon

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net