Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Mastering UML with Rational Rose 2002.pdf
Скачиваний:
137
Добавлен:
02.05.2014
Размер:
9.68 Mб
Скачать

Chapter 7: Attributes and Operations

Select Options → Suppress Operations.

OR

1.

Select the desired class on a diagram.

2.

Select Edit → Diagram Object Properties → Suppress Operations.

To show operation signatures on a Class diagram:

1.

Select the desired class on a diagram.

2.

Right−click on the class to display the shortcut menu.

3.

Select Options → Show Operation Signature.

To change the default option for showing operations:

1.

Select Tools → Options.

2.

Select the Diagram tab.

3.

Use the Suppress Operations, Show All Operations, and Show Operation Signatures check boxes to set the default options.

Note When the default is changed, only new diagrams will be affected. Existing Class diagrams will not be changed.

Showing Visibility

There are four visibility options for attributes and operations: public, private, protected, and package. In UML, these are represented by icons (+, −, and #) for public, private, and protected, and no icon for implementation.

Rather than using UML notation, you can use Rose notation for attribute and operation visibility. The Rose and UML notations for attribute and operation visibility are listed in Table 7.3.

Table 7.3: Rose and UML Visibility Notations

Rose Notation

Visibility

UML Notation

 

Public

+

 

Private

 

Protected

#

290

Chapter 7: Attributes and Operations

 

Package or implementation

<no icon>

 

 

 

You can use either UML or Rose notation for visibility, or you can hide the visibility icons altogether.

To show attribute and operation visibility for a class:

1.

Select the desired class on a diagram.

2.

Right−click on the class to display the shortcut menu.

3.

Select Options → Show Visibility.

To change the default visibility display option:

1.

Select the Tools → Options.

2.

Select Diagram tab.

3.

Use the Show Visibility check box to set the default option.

To switch between Rose and UML visibility notations:

1.

Select Tools → Options.

2.

Select the Notation tab.

3.

Use the Visibility as Icons check box to switch between notations. If the check box is selected, Rose notation will be used. If the check box is not selected, UML notation will be used.

Showing Stereotypes

In Rose, you can show or hide the stereotypes of your operations and attributes. If you show the stereotypes, they will be displayed before the attribute and operation names, enclosed in double angle brackets (<<>>):

291