comp-350 object-oriented analysis and design drawing system sequence diagrams reference: larman,...

26
COMP-350 Object-Oriented Analysis and Design Drawing System Sequence Diagrams Reference: Larman, Chapter 9

Upload: lionel-sanders

Post on 04-Jan-2016

213 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: COMP-350 Object-Oriented Analysis and Design Drawing System Sequence Diagrams Reference: Larman, Chapter 9

COMP-350 Object-Oriented Analysis and Design

Drawing System Sequence Diagrams

Reference: Larman, Chapter 9

Page 2: COMP-350 Object-Oriented Analysis and Design Drawing System Sequence Diagrams Reference: Larman, Chapter 9

2

Objectives

Identify System Events (input/output). Create System Sequence diagrams to show

events.

Page 3: COMP-350 Object-Oriented Analysis and Design Drawing System Sequence Diagrams Reference: Larman, Chapter 9

3

Iteration 1

First real development iteration. The requirement work done during inception

phase was to decide if the project was worth more serious investigation.

Before starting iteration 1 design work, further investigation of the problem domain is useful such as clarification of the input and output system events, related to the system.

Page 4: COMP-350 Object-Oriented Analysis and Design Drawing System Sequence Diagrams Reference: Larman, Chapter 9

System Sequence Diagram (SSD)

An SSD is an artifact that illustrates input and output events related to the system under discussion.

A diagram that shows, for ONE particular scenario of a use case, the events that external actors generate, their order, and INTER-system events. (not detailed method calls between objects)

4

Page 5: COMP-350 Object-Oriented Analysis and Design Drawing System Sequence Diagrams Reference: Larman, Chapter 9

SSD in UML

The UML contains notation in the form of sequence diagrams to illustrate events from external actors to a system

5

Page 6: COMP-350 Object-Oriented Analysis and Design Drawing System Sequence Diagrams Reference: Larman, Chapter 9

6

SSD—System Behavior

System behavior as shown in SSD is “Black Box”.

Focuses on what, not on how or why

Page 7: COMP-350 Object-Oriented Analysis and Design Drawing System Sequence Diagrams Reference: Larman, Chapter 9

What are Events

Use cases describe how external actors interact with the software system

During this interaction an actor generates events to a system, usually requesting some operation in response.

For example, when a cashier enters an item's ID, the cashier is requesting the POS system to record that item's sale. The request event initiates an operation upon the system.

7

Page 8: COMP-350 Object-Oriented Analysis and Design Drawing System Sequence Diagrams Reference: Larman, Chapter 9

Advice

An SSD should be done for the main success scenario of the use case, and frequent or complex alternative scenarios.

8

Page 9: COMP-350 Object-Oriented Analysis and Design Drawing System Sequence Diagrams Reference: Larman, Chapter 9

9

Notation

Object: Objects are instances of classes. Object is represented as a rectangle which contains the name of the object underlined.

:Object1

Page 10: COMP-350 Object-Oriented Analysis and Design Drawing System Sequence Diagrams Reference: Larman, Chapter 9

10

Notation (2)

Actor: An Actor is modeled using the ubiquitous symbol, the stick figure.

actor1

Page 11: COMP-350 Object-Oriented Analysis and Design Drawing System Sequence Diagrams Reference: Larman, Chapter 9

11

Notation (3) Lifeline: The Lifeline identifies the existence of the object

over time. The notation for a Lifeline is a vertical dotted line extending from an object.

Page 12: COMP-350 Object-Oriented Analysis and Design Drawing System Sequence Diagrams Reference: Larman, Chapter 9

12

Notation (4)

Message: Messages, modeled as horizontal arrows between Activations, indicate the communications between objects.

messageName(argument)

Page 13: COMP-350 Object-Oriented Analysis and Design Drawing System Sequence Diagrams Reference: Larman, Chapter 9

13

Example of an SSD: Process Sales

Following example shows the success scenario of the Process Sale use case.

Events generated by cashier (actor)

   makeNewSale()

    enterItem(itemID, quantity)

     endSale()

and

     makePayment(amount).

Page 14: COMP-350 Object-Oriented Analysis and Design Drawing System Sequence Diagrams Reference: Larman, Chapter 9

14

SSD for Process Sale scenario

Page 15: COMP-350 Object-Oriented Analysis and Design Drawing System Sequence Diagrams Reference: Larman, Chapter 9

15

System Sequence Diagrams and Use Cases

System Sequence Diagram is generated from inspection of a use case.

Constructing a systems sequence diagram from a use case

1.Draw a line representing the system as a black box. 2.Identify each actor that directly operates

on the system. Draw a line for each such actor.

Page 16: COMP-350 Object-Oriented Analysis and Design Drawing System Sequence Diagrams Reference: Larman, Chapter 9

16

System Sequence Diagrams and Use Cases

     3.From the use case text, identify the system (external) events that each actor generates. They will correspond to an entry in the right hand side of the typical use case. Illustrate them on the diagram.

4.Optionally, include the use case text to the left of the diagram.

Page 17: COMP-350 Object-Oriented Analysis and Design Drawing System Sequence Diagrams Reference: Larman, Chapter 9

17

SSDs are derived from use cases.

Page 18: COMP-350 Object-Oriented Analysis and Design Drawing System Sequence Diagrams Reference: Larman, Chapter 9

18

Defining system boundary (system itself).

Page 19: COMP-350 Object-Oriented Analysis and Design Drawing System Sequence Diagrams Reference: Larman, Chapter 9

19

Naming System Events and Operations

System event External input event generated by an actor. Initiates a responding operation by system.

System operation Operation invoked in response to system

event.

Page 20: COMP-350 Object-Oriented Analysis and Design Drawing System Sequence Diagrams Reference: Larman, Chapter 9

20

Naming System Events and Operations(2)

In order to improve the clarity, it is appropriate to start the name of the system event with a verb (for example- add….,enter….,end….,make…. etc.,).

Page 21: COMP-350 Object-Oriented Analysis and Design Drawing System Sequence Diagrams Reference: Larman, Chapter 9

21

Naming System Events and Operations(3)

System events (and their associated system operations) should be expressed at the level of intent rather than in terms of the physical input medium or interface widget level.

For example “enterItem” is better than “scan” as it captures the intent of operation rather than what interface is used to capture the system event (design choice).

Page 22: COMP-350 Object-Oriented Analysis and Design Drawing System Sequence Diagrams Reference: Larman, Chapter 9

22

Choose event and operation names at an abstract level

Page 23: COMP-350 Object-Oriented Analysis and Design Drawing System Sequence Diagrams Reference: Larman, Chapter 9

23

Showing Use Case Text

It is desirable to show at least fragments of use case text for the scenario.

The text provides the details and context, while the diagram visually summarizes the interaction.

Page 24: COMP-350 Object-Oriented Analysis and Design Drawing System Sequence Diagrams Reference: Larman, Chapter 9

24

SSD with use case text

Page 25: COMP-350 Object-Oriented Analysis and Design Drawing System Sequence Diagrams Reference: Larman, Chapter 9

25

System Sequence Diagrams Within the Unified Process

1.Inception: System Sequence Diagrams are not usually motivated in inception.

 

Page 26: COMP-350 Object-Oriented Analysis and Design Drawing System Sequence Diagrams Reference: Larman, Chapter 9

26

System Sequence Diagrams Within the Unified Process

Elaboration: It is useful to create System Sequence Diagrams during elaboration in order to -

Identify the system events and major operations. To write system operation contracts (Contracts

describe detailed system behavior) and To support estimation.