(^282) | Object-Oriented Software Design and Implementation
Figure 6.5 A Scenario Walk-through in Progress
Book says, “I need to collaborate with Name.” Name says, “I have the responsibilities to know
my first, middle, and last names. These are already on my card, so I’m done.” The Name card
is then lowered. Book says, “I keep collaborating with Entry, getting a new Name object until I
find the matching name. Then I must return the entry from which the name came to User
Interface.” Now the Book card is lowered. Next, the User Interface says, “I need to get the ad-
dress from Entry.” This collaboration is placed on its card and the Entry card is held up again,
with its holder saying “I have a responsibility to provide an address. I’m not going to collabo-
rate with Address, but am just going to return the Address object to User Interface.” The Entry
card has this responsibility added and then goes back on the table. Figure 6.6 shows User
Interface’s, Book’s, and Entry’s CRC cards after this scenario. Notice that we have included
Entry’s knowledge responsibilities.
At this point, the holder of User Interface (whose arm is getting very tired) says, “I need
to collaborate with Address to get each line of the address as a string that I can place in a pair
of labels.” Address is raised, with its holder saying, “I have responsibilities to know my street,
やまだぃちぅ
(やまだぃちぅ)
#1