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

Chapter 3: Business Modeling

To view the relationship specifications:

1.

Double−click the relationship in the list.

2.

The relationship specification window will appear. See the section "Working with Relationships" later in this chapter for a detailed description of relationship specifications.

OR

1.

Right−click the relationship in the list.

2.

Select Specification from the shortcut menu.

3.

The relationship specification window will appear. See the section "Working with Relationships" later in this chapter for a detailed description of relationship specifications.

To delete a relationship:

1.

Right−click the relationship in the list.

2.

Select Delete from the shortcut menu.

Working with Business Actors

As you now know, a business actor is anyone or anything outside the business that interacts with it. Once you identify the business actors for your organization, the next step is to add them to the Rose model and create relationships between the business actors and business use cases.

Adding Business Actors

Like business use cases, business actors are added to the Rose model by adding them to a Use Case diagram. The first step in the process is to create or open a Use Case diagram. Once you have, you can add business actors using the toolbar.

To add a business actor to a Use Case diagram:

1.

87

Chapter 3: Business Modeling

Select the Business Actor button from the toolbar (the yellow actor icon is a business actor).

2.

Click anywhere inside the Use Case diagram. The new business actor will be named NewClass by default.

3.

With the new actor selected, type in its name. Note that the new business actor has been automatically added to the browser under the Use Case view.

Adding Actor Specifications

Details about the business actor, such as the name, relationships, and attributes, are controlled through the business actor specifications window, shown in Figure 3.14.

Figure 3.14: Business actor specification window

As you work with classes later in this book, you may note that the actor specification window and the class specification window are very similar. This is because Rose treats an actor as a specialized form of a class. The actor specification window includes the same fields as the class specification window, but some of these fields are disabled for actors.

To open the business actor specifications:

1.

Right−click the business actor on the Use Case diagram.

2.

Select Open Specification from the shortcut menu.

OR

1.

Right−click the actor in the browser.

2.

Select Open Specification from the shortcut menu.

88

Chapter 3: Business Modeling

OR

1.

Select the actor on the Use Case diagram.

2.

Select Browse Specification.

OR

1.

Select the actor on the Use Case diagram.

2.

Press Ctrl+B.

Assigning an Actor Stereotype

A stereotype is a way to categorize model elements in UML. Stereotypes are used when you have many different types of one element. For example, Visual Basic has a number of different types of classes: interface, form, control, collection, and so on. Each of these is represented in UML as a different stereotype.

The same concept applies to business actors. You may have several different types of business actors: those from supplier companies, those from government agencies, those from customer companies, and so on. If you would like, you can create your own stereotypes to categorize your business actors. You assign a stereotype to a business actor in the specifications window.

To assign a business actor stereotype:

1.

Right−click the business actor in the browser or on a Use Case diagram.

2.

Select Open Specification from the shortcut menu.

3.

In the Stereotype field, enter the business actor stereotype.

Warning If you change the stereotype of a business actor, Rose will no longer display the actor using the UML actor symbol. It will display it as a box instead. This won't affect the rest of your model, but may make the Use Case diagram harder to understand.

Setting Business Actor Multiplicity

Multiplicity refers to the number of instances you expect to have for a particular business actor. For example, you may expect to have 300,000 people play the role of customer. You can capture this information in the specifications window.

Rose provides you with several multiplicity options:

Multiplicity

Meaning

89

Chapter 3: Business Modeling

 

 

 

 

0..0

Zero

 

0..1

Zero or one

 

0..n

Zero or more

 

1..1

Exactly one

 

1..n

One or more

 

n (default)

Many

 

Or, you can enter your own multiplicity, using one of the following formats:

 

 

 

 

Format

Meaning

Example

<number>

Exactly <number>

3

<number 1>..<number 2>

Between <number 1> and <number 2>

3..7

<number>..n

<number> or more

3..n

<number 1>,<number 2>

<number 1> or <number 2>

3, 7

<number 1>,<number 2>.. <number 3>

Exactly <number 1> or between <number

3, 7–9

 

2> and <number 3>

 

<number 1>..<number 2>, <number 3>..<number 4>

Between <number 1> and <number 2> or

3–5, 7–10

 

between <number 3> and <number 4>

 

To set business actor multiplicity:

 

 

1.

Right−click the business actor in the browser or on a Use Case diagram.

2.

Select Open Specification from the shortcut menu.

3.

Select the Detail tab.

4.

Select from the Multiplicity drop−down list box, or type in the business actor's multiplicity using one of the formats listed above.

Viewing Relationships for a Business Actor

As with business use cases, you can view all of the relationships for a business actor either by using the Relations tab in the specification window or by going through the browser.

To view the relationships for a business actor:

1.

Right−click the business actor in the browser or on a Use Case diagram.

2.

Select Open Specification from the shortcut menu. The relationships will be listed on the Relations tab.

OR

90