01.01.2015 Views

UML Weekend Crash Course™ - To Parent Directory

UML Weekend Crash Course™ - To Parent Directory

UML Weekend Crash Course™ - To Parent Directory

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Session 19—Applying the Collaboration Diagram to the Case Study 201<br />

The self-references also become operations. They may be private operations invoked only<br />

by the owning object, or they may appear as public, called by other objects in other scenarios.<br />

Examine all the scenarios to determine the most appropriate implementation.<br />

Tip<br />

Conditions from the Sequence and Collaboration diagrams are placed in the<br />

implementation logic of the operation’s method.<br />

REVIEW<br />

The Collaboration diagram models interactions between objects in much the same way that<br />

the Sequence diagram does. However, the Collaboration diagram uses the Object diagram<br />

as the framework for modeling the events. <strong>To</strong> construct the Object diagram,<br />

1. Identify the participating objects.<br />

2. Lay them out to provide enough room to arrange the events between them.<br />

3. Draw the links between the objects based on the rules set by the Class diagram<br />

associations.<br />

4. Each event in the sequence becomes at least one horizontal arrow from the sending<br />

object to the receiving object. The type of arrow depends on the type of event.<br />

Regardless of the type, the arrow is placed parallel to the link.<br />

5. For a synchronous event, or procedure call, that requires a reply, place a second<br />

arrow parallel to the link running in the opposite direction. Replies use a dashed<br />

line style arrow.<br />

6. Continue to represent each event as an arrow running parallel to the links, adding<br />

a sequence number to each event to indicate the order of execution, until all the<br />

events have been translated onto the Collaboration diagram.<br />

QUIZ YOURSELF<br />

1. What arrangement do you use for the objects in a Collaboration diagram (See<br />

“Building a Collaboration Diagram from a Scenario.”)<br />

2. How do you indicate the order of execution in a Collaboration diagram (See<br />

“Building a Collaboration Diagram from a Scenario.”)<br />

3. How do you handle the fact that some sets of events need to be repeated (See<br />

“Building a Collaboration Diagram from a Scenario.”)<br />

4. Each event becomes an operation. How does the Collaboration diagram help you<br />

know what class to add them to (See “Mapping the Sequence and Collaboration<br />

Diagram Elements to the Class Diagram.”)<br />

5. How do the return values effect the operations (See “Mapping the Sequence and<br />

Collaboration Diagram Elements to the Class Diagram.”)

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!