UML Designer User's Guide
Consider Catalog, which we have identified as a thing in the
library catalog example. Based on our use cases, Catalog
(which we have identified as a thing) might have the following
responsibilities:
- Add catalog entry
- Assign accession number to entry
- Find entry by search criteria
- Remove catalog entry
To add these responsibilities of Catalog to the model, follow
these steps:
- Select Things in the middle pane of the Relationships
Browser.
- Select Catalog from the list of things.
- Select New>Responsibility from the pop-up menu of
Catalog. A window appears prompting you for the details of
the new responsibility.
- Type Add catalog entry and select OK.
- For Idiom, accept the default (Action). This
responsibility describes something Catalog does.
Don't worry about participants for now; we will deal with those
shortly.
- Repeat the same procedure for the other responsibilities listed
above.
Similarly, you can create responsibilities for actors by following the same
steps. Select the actor Librarian and add the following
responsibilities:
- Input new catalog entry
- Classify book and assign Dewey number
- Query catalog using search criteria
- Remove existing catalog entry
Note: | Because Actor elements are not transformed into protocols, actor
responsibilities do not have idioms.
|
All of the responsibilities we have added for Catalog have been
simple "action" responsibilities. However, consider another Thing,
Catalog Entry; it does not have to do anything except keep
track of its own attributes (author, title, and accession number). We
can define these as responsibilities using the Value idiom to give
us a head start on implementation later.
To add these responsibilities, follow these steps:
- In the Relationships Browser, select Catalog Entry from the
list of things.
- Select New>Responsibility from the pop-up menu. A
window appears prompting you for the details of the new responsibility.
- For Idiom, select Value. This responsibility
describes something Catalog Entry keeps.
- In the Responsibility Namefield, type Author.
(We phrase this responsibility as a noun because it describes a value rather
than an action.)
- For Max Cardinality, select 1.
- Optionally, we could specify a participant defining the type of the value
being kept. At this point, though, we aren't really interested in
how the author will be represented, so accept the default and select
OK.
- Repeat the same process for two other responsibilities, Title
and Accession Number.
Because we used the Value idiom for these responsibilities, UML
Designer can generate appropriate sets of messages when we transform
Catalog Entry into a protocol. We'll see how this works
in Protocols.
[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]