Page 300 -
P. 300
chaPter 10 • object-oriented systems analysis and design Using Uml 267
Figure 10.10
::Class Object::Class Specialized symbols used to draw
a sequence diagram.
method(Parameter)
return
asynchronousSignal( )
represent synchronous calls, which are the most common. These are used when the sending class
waits for a response from the receiving class, and control is returned to the sending class when
the class receiving the message finishes executing. Half (or open) arrowheads represent asyn-
chronous calls, or those that are sent without an expectation of returning to the sending class.
An example would be using a menu to run a program. A return is shown as an arrow, sometimes
with a dashed line. Messages are labeled using one of the following formats:
• The name of the message followed by empty parentheses: messageName( ).
• The name of the message followed by parameters in parentheses:
messageName(parameter1, parameter2 . . .).
• The message name followed by the parameter type, parameter name, and any default value
for the parameter in parentheses:
messageName(parameterType:parameterName(defaultValue). Parameter types indicate
the type of data, such as string, number, or date.
• The message may be a stereotype, such as «Create», indicating that a new object is created
as a result of the message.
Timing in the sequence diagram is displayed from top to bottom; the first interaction is
drawn at the top of the diagram, and the interaction that occurs last is drawn at the bottom of the
diagram. The interaction arrows begin at the bar of the actor or object that initiates the interac-
tion, and they end pointing at the bar of the actor or object that receives the interaction request.
The starting actor, class, or object is shown on the left. This may be the actor that initiates the
activity or it may be a class representing the user interface.
Figure 10.11 is a simplified example of a sequence diagram for a use case that admits a student
to a university. On the left is the newStudentUserInterface class that is used to obtain student
information. The initialize( ) message is sent to the Student class, which creates a new student
record and returns the student number. To simplify the diagram, the parameters that are sent to
the Student class have been omitted, but would include the student name, address, and so on. The
next activity is to send a selectDorm message to the Dorm class. This message would include
dorm selection information, such as a health dorm or other student requirements. The Dorm class
returns the dorm name and room number. The third activity is to send a selectProgram message
to the Program class, including the program name and other course of study information. The
program advisor name is returned to the newStudentUserInterface class. A studentComplete
message is sent to the Student class with the dorm, advisor name, and other information.