lecture 4: sequence interaction diagrams

29
1 Copyright W. Howden Lecture 4: Sequence Interaction Diagrams

Upload: others

Post on 06-Oct-2021

4 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Lecture 4: Sequence Interaction Diagrams

1Copyright W. Howden

Lecture 4: Sequence Interaction Diagrams

Page 2: Lecture 4: Sequence Interaction Diagrams

2Copyright W. Howden

Behavioral vs Static Models

• Describe interactions between entities

• Sequence Diagrams• Collaboration

Diagrams• Message Sequence

Charts• State Charts

• Describe structure of complex entities

• Class Diagrams• Entity-relationship

models

Page 3: Lecture 4: Sequence Interaction Diagrams

3Copyright W. Howden

Sequence Diagrams - Components

• Objects– Actors, subsystems, class instances

• Messages– One object sends a message to another message

• Each diagram describes a scenario, or what happens during a use of the system

• System described by a collection of diagrams

Page 4: Lecture 4: Sequence Interaction Diagrams

4Copyright W. Howden

: Member : GUI : DomainLogic : DataBase

setMemberData()

setMemberData(dateeData, name)

getMemberData(name)

upDateMemberData(memberData)

Set member data scenario

Preceded by and followed by LogOn and LogOff scenarios

Page 5: Lecture 4: Sequence Interaction Diagrams

5Copyright W. Howden

Applicability• System/Actor interaction

– Requirements elaboration

• Subsystem interactions– Requirements elaboration and design

• Subsystem design– Object properties and class visibility

Page 6: Lecture 4: Sequence Interaction Diagrams

6Copyright W. Howden

System Actor Interaction

• Investigate the interactions the user has with the system

• Specify the needed user interface forms– Specify contents/capabilities of GUI before

graphical design• Following example note: In the actor/system

interaction we see self-messages notation

Page 7: Lecture 4: Sequence Interaction Diagrams

7

Page 8: Lecture 4: Sequence Interaction Diagrams

8Copyright W. Howden

Subsystems Interaction

• Show the messages that the subsystems send back and forth

• Enforce a layers architecture• Identify the subsystems interface/proxy• In the following example we see the

alternatives notation, which allows multiple related flows to be included in

Page 9: Lecture 4: Sequence Interaction Diagrams

9

Page 10: Lecture 4: Sequence Interaction Diagrams

10Copyright W. Howden

Additional Examples

• Get a Date Scenario– Includes conditionals allowing alternative paths

in same scenario/ISD

• Start up Scenario– Shows interactions with system

• Log On Scenario• Exit/Log Off Scenario

Page 11: Lecture 4: Sequence Interaction Diagrams

11

Page 12: Lecture 4: Sequence Interaction Diagrams

12Copyright W. Howden

: User : Start : GUI : System

DatingSystem

Execute(main)

create()

Start up scenario

At this point follow LogOn/LogOff scenarios

show()

Page 13: Lecture 4: Sequence Interaction Diagrams

13

Page 14: Lecture 4: Sequence Interaction Diagrams

14Copyright W. Howden

: User : GUI : DomainLogic : DataBase : System

display Start/End

End

Log Off scenario

exit()

Page 15: Lecture 4: Sequence Interaction Diagrams

15Copyright W. Howden

Additional Notation

• Focus of Control– Indicate when an object’s lifestream is “active”

• Data return from a sent message• Iteration of message

Page 16: Lecture 4: Sequence Interaction Diagrams

16Copyright W. Howden

: Member : GUI : DomainLogic : DataBase

getDate()

displayOptionChoice()

dsiplayDaterPreferencesForm()

daterPreferences()

getDate()

memberData:=getFirst()

memberData:=*getNext()

searchResult

[null] displaySorry()

[notNull] displayDateProps()

Page 17: Lecture 4: Sequence Interaction Diagrams

17Copyright W. Howden

Systematic Object Identification for Sequence Diagrams

• Rational Software approach (Rational now part of IBM and source of Rational Unified Process)

• Four kinds of objects– Actor– Boundary/Form– Entity/Data– Control

Page 18: Lecture 4: Sequence Interaction Diagrams

18Copyright W. Howden

Boundary Objects

• Place where the actors interface with the system

• Referred to as forms by some methods

Page 19: Lecture 4: Sequence Interaction Diagrams

19Copyright W. Howden

Entity

• Data type objects• Place where information is stored• Data Bases

Page 20: Lecture 4: Sequence Interaction Diagrams

20Copyright W. Howden

Control

• Coordinates the activities of the use case• Often identified with a use case, with one

per use case• Possible controller objects in O/O

– Use Case, Role, System/subsystem, and Business

Page 21: Lecture 4: Sequence Interaction Diagrams

21Copyright W. Howden

Actor Control Entity/Data 1 Entity/Data 2

Open

Form

Enter information

Save/Process

Save/Process

Create

Populate

Access/Retrieve

Message1

Page 22: Lecture 4: Sequence Interaction Diagrams

22Copyright W. Howden

Additional Notations – Message Synchronization

• Synchronous: sender waits until receiver has processed message

• Procedure call: receiver is ready to receive call, sender waits for return from call. A kind of synchronous

• Asynchronous: sender sends message and then continues regardless of status of receiver

• Balking: if receiver is not ready to receive message it is abandoned

Page 23: Lecture 4: Sequence Interaction Diagrams

23Copyright W. Howden

Application to Distributed Systems

• Sequence diagrams show collections of interactions between components in system, like subsystem interaction diagrams

• Can use to develop specifications for components, with individual state diagrams

Page 24: Lecture 4: Sequence Interaction Diagrams

24Copyright W. Howden

DS Scenarios For Distributed System

• Scenario 1– User who is a member logs on and asks for a date. A

date is found. Client relies on server to supply first and subsequent records from member Data base.

• Scenario 2– User logs on who is not a member. Then a user who is a

member logs on. The client eventually asks the server for the next record and nil is returned since there are no more. Client displays a sorry-no-date message.

Page 25: Lecture 4: Sequence Interaction Diagrams

25

Page 26: Lecture 4: Sequence Interaction Diagrams

26Copyright W. Howden

Page 27: Lecture 4: Sequence Interaction Diagrams

27Copyright W. Howden

Developing a State Model Specification for a Component

• Factor the sequence diagrams, e.g. for the Client, get all the client lifelines

• Decide where the states are– E.g. For Client, each new GUI Frame?

• Not always an exact match with the traces

– After each message received

Page 28: Lecture 4: Sequence Interaction Diagrams

28Copyright W. Howden

Page 29: Lecture 4: Sequence Interaction Diagrams

29Copyright W. Howden