System sequence diagram (SSD)

28
System sequence diagram (SSD) SENG 403 SENG 403 – Winter 2012

description

SENG 403. System sequence diagram (SSD). Agenda. Brief introduction to SSD Example (A sales systems (Cashier)) Example (Monopoly game). What is an SSD ?. A system sequence diagram (SSD): is a fast and easily created artifact. illustrates input and output events related to the systems. - PowerPoint PPT Presentation

Transcript of System sequence diagram (SSD)

Page 1: System sequence diagram (SSD)

SENG 403 – Winter 2012

System sequence diagram (SSD)

SENG 403

Page 2: System sequence diagram (SSD)

SENG 403 – Winter 2012

Agenda

Brief introduction to SSD Example (A sales systems (Cashier)) Example (Monopoly game)

Page 3: System sequence diagram (SSD)

SENG 403 – Winter 2012

What is an SSD?

A system sequence diagram (SSD): is a fast and easily created artifact. illustrates input and output events related to

the systems.

Page 4: System sequence diagram (SSD)

SENG 403 – Winter 2012

Example 1 (from Trace Modeller Co.)

Page 5: System sequence diagram (SSD)

SENG 403 – Winter 2012

Review

A fast review of the notions and rules in UML sequence diagrams

Page 6: System sequence diagram (SSD)

SENG 403 – Winter 2012

Synchronous message 1

The sender waits until the receiver has finished processing the message, only then does the caller continue (i.e. a blocking call).

Most method calls in object-oriented programming languages are synchronous.

A closed and filled arrowhead signifies that the message is sent synchronously.

Page 7: System sequence diagram (SSD)

SENG 403 – Winter 2012

Synchronous message 2

If you want to show that the receiver has finished processing the message and returns control to the sender, draw a dashed arrow from receiver to sender. ▪ Optionally, a value that the receiver returns

to the sender can be placed near the return arrow

Page 8: System sequence diagram (SSD)

SENG 403 – Winter 2012

Found message

A message of which the caller is not shown. Either ▪ the sender is not known, ▪ or that it is not important who the sender

was. Originates from a filled circle

Page 9: System sequence diagram (SSD)

SENG 403 – Winter 2012

Asynchronous message

The sender does not wait for the receiver to finish processing the message

An open arrowhead is used to indicate that a message is sent asynchrously.

Page 10: System sequence diagram (SSD)

SENG 403 – Winter 2012

Self message

An object sends to itself

Page 11: System sequence diagram (SSD)

SENG 403 – Winter 2012

Instantaneous message 1

The time it takes to arrive at the receiver is negligible.

Drawn as a horizontal arrow.

Page 12: System sequence diagram (SSD)

SENG 403 – Winter 2012

Non-instantaneous message

Sometimes it takes a considerable amount of time to reach the receiver. E.g. across a network.

Such a non-instantaneous message is drawn as a slanted arrow.

Page 13: System sequence diagram (SSD)

SENG 403 – Winter 2012

Loop 1

Prefixed with an asterisk. The message is sent repeatedly. A guard indicates the condition that

determines whether or not the message should be sent (again).

Page 14: System sequence diagram (SSD)

SENG 403 – Winter 2012

loop2

Sending the same message to different elements in a collection.

The receiver of the repeated message is a multiobject.

Page 15: System sequence diagram (SSD)

SENG 403 – Winter 2012

Loop 3

Multiple messages sent in the same iteration a 'loop' combined fragment can be used.

Page 16: System sequence diagram (SSD)

SENG 403 – Winter 2012

Conditional 1

The message is only sent if a certain condition is met.

The condition is between brackets.

Page 17: System sequence diagram (SSD)

SENG 403 – Winter 2012

Conditional 2

Several messages conditionally sent under the same guard (condition).▪ Use an 'opt' combined fragment.

The combined fragment is shown as a large rectangle with an 'opt' operator plus a guard

▪ contains all the conditional messages under that guard

Page 18: System sequence diagram (SSD)

SENG 403 – Winter 2012

Conditional 3

Alternative interactions▪ use an 'alt' combined fragment.

Page 19: System sequence diagram (SSD)

SENG 403 – Winter 2012

Example 2

Success scenario of a cash-only Process Sale scenario.

The cashier generates makeNewSale, enterItem, endSale, and makePayment system events.

Page 20: System sequence diagram (SSD)

SENG 403 – Winter 2012

Example 2 (continued) Sequence diagrams and system operation handling.

In the current iteration (for this sales system) we are considering the following scenarios and system operations: makeNewSale enterItem endSale makePayment

Page 21: System sequence diagram (SSD)

SENG 403 – Winter 2012

Example 2 (Continued)

Lower level (detailed in the domain layer)

Page 22: System sequence diagram (SSD)

SENG 403 – Winter 2012

Example 2 (Continued)

Naming issues

“enterItem” is better than “scan” (that is, laser scan) because it captures the intent of the operation while remaining abstract and noncommittal with respect to design choices about what interface is used to capture the system event.

It could by via laser scanner, keyboard, voice input, or anything.

Page 23: System sequence diagram (SSD)

SENG 403 – Winter 2012

Example 3 (Monopoly game)

Page 24: System sequence diagram (SSD)

SENG 403 – Winter 2012

Example 3(SSD for a Play Monopoly Game scenario.)

1. Initialization 2. Play game

Page 25: System sequence diagram (SSD)

SENG 403 – Winter 2012

Example 3Practice: Do not start we initializations

Page 26: System sequence diagram (SSD)

SENG 403 – Winter 2012

Example 3

Page 27: System sequence diagram (SSD)

SENG 403 – Winter 2012

Example 3

Page 28: System sequence diagram (SSD)

SENG 403 – Winter 2012

Resources

Website (tool):▪ Trace modeller (UML Sequence Diagram Editor) ▪ A gallery of UML sequence diagrams:

http://www.tracemodeler.com/gallery/index.html

Book: Craig Larman, Applying UML and Patterns: An Introduction to Object-Oriented

Analysis and Design and the Unified Process (3nd Edition), Prentice Hall PTR. Chapters 10, 15 and 18

Video: UML Sequence diagram basics review:

▪ http://www.youtube.com/watch?v=SPwUtekrqS8

Online article:▪ Donald Bell, IBM Corporation, UML Basics: The sequence diagram. http://

www.ibm.com/developerworks/rational/library/3101.html