Drawing System Sequence Diagrams Chapter 10 Applying UML

  • Slides: 22
Download presentation
Drawing System Sequence Diagrams Chapter 10 Applying UML and Patterns Craig Larman

Drawing System Sequence Diagrams Chapter 10 Applying UML and Patterns Craig Larman

UP Artifacts

UP Artifacts

Sequence Diagrams n Shows objects and classes involved in a use case scenario n

Sequence Diagrams n Shows objects and classes involved in a use case scenario n Shows the messages exchanged between objects in time order sequence n Used in design to assign object responsibilities n Can be used test user interface requirements 3

System Sequence Diagrams (SSDs) n SSD is an artifact of analysis that illustrates input

System Sequence Diagrams (SSDs) n SSD is an artifact of analysis that illustrates input and output events related to the system. n SSD is associated with use-case realization in the logical view of system development. 4

SSDs and System Behavior n System behaves as “Black Box”. n Interior objects are

SSDs and System Behavior n System behaves as “Black Box”. n Interior objects are not shown, as they would be on a Sequence Diagram. : System 5

Use Cases are Source for SSD n Use cases describe n n n How

Use Cases are Source for SSD n Use cases describe n n n How actors interact with system. Typical course of events that external actors generate and The order of the events. 6

SSD Components For a particular scenario of use-case an SSD showsn The external actors

SSD Components For a particular scenario of use-case an SSD showsn The external actors that interact directly with the system. n The System (as a black box). n The system events that the actors generate. 7

What SSDs Show n Match operations of the system in response to the events

What SSDs Show n Match operations of the system in response to the events generated n Depict the temporal order of the events. n Should be done for the main success scenario of the use-case n Also for frequent and alternative scenarios 8

Objects on SSDs n Objects are instances of classes. n Represented as a rectangle

Objects on SSDs n Objects are instances of classes. n Represented as a rectangle which contains the name of the object underlined n Because the system is instantiated, it is shown as an object. : Object 1 9

Actors on SSDs n Actor: An Actor is modeled using the ubiquitous symbol, the

Actors on SSDs n Actor: An Actor is modeled using the ubiquitous symbol, the stick figure. actor 1 10

Lifelines on SSDs n Life. Line identifies the existence of the object over time.

Lifelines on SSDs n Life. Line identifies the existence of the object over time. The notation for a Lifeline is a vertical dotted line extending from an object. 11

Messages on SSDs n Messages, modeled as horizontal arrows between Activations, indicate the communications

Messages on SSDs n Messages, modeled as horizontal arrows between Activations, indicate the communications between objects. message. Name(argument) 12

Example of an SSD Following example shows the success scenario of the Process Sale

Example of an SSD Following example shows the success scenario of the Process Sale use case. n Events generated by cashier (actor)- make. New. Sale enter. Item end. Sale make. Payment. n 13

SSD for Process Sale scenario 14

SSD for Process Sale scenario 14

Create SSDs for each Use Case 1. Draw a lifeline representing the system as

Create SSDs for each Use Case 1. Draw a lifeline representing the system as a 2. 3. 4. 5. black box. Identify each actor that directly operates on the system. Draw a lifeline for each actor From the use case happy path text, identify system (external) events that actors generate (look at right side of the flow of events). Add them as messages to diagram. Add the main outputs from the use case as messages back to actor – see use case table Optionally, include the use case text to the left of the diagram. 15

SSDs are derived from use cases. 16

SSDs are derived from use cases. 16

System Events and System Boundary n To identify the system events, knowing the system

System Events and System Boundary n To identify the system events, knowing the system boundary is critical. n For the purpose of software development, the system boundary is chosen to be the software system itself. 17

Determining SSD System Boundary Identifying the System events 1. Determine the actors that directly

Determining SSD System Boundary Identifying the System events 1. Determine the actors that directly interact with the system. 2. In the process Sale example, the customer does not directly interact with the POS system. Cashier interacts with the system directly. Therefore cashier is the generator of the system events. n 18

Defining system boundary. 19

Defining system boundary. 19

Naming System Events and Operations System event n External input event generated by an

Naming System Events and Operations System event n External input event generated by an actor. n Initiates a responding operation by system. n In order to improve the clarity, it is appropriate to start the name of the system event with a verb System operation n Operation invoked in response to system event. 20

Choosing SSD event / operation names “enter. Item” is better than “scan” as it

Choosing SSD event / operation names “enter. Item” is better than “scan” as it captures the intent of operation rather than what interface is used to capture the system event (design choice). 21

SSDs in Analysis SSDs are a visualization of the interactions implied in the use

SSDs in Analysis SSDs are a visualization of the interactions implied in the use cases. It is useful to create SSDs during analysis to: n Identify the system events and major operations n Write system operation contracts (Contracts describe detailed system behavior) n Provide a way for us to visually step through invocation of the operations in Use-Cases. 22