Upload
polly-short
View
214
Download
0
Tags:
Embed Size (px)
Citation preview
ZEIT2301Design of Information Systems
Interaction Design: Sequence Diagrams
School of Engineering and Information TechnologyUNSW@ADFA
Dr Kathryn Merrick
2
Topic 07: Interaction Design
Objectives To discuss the role of interaction diagrams in IS development.
To understand the notation, rules and style guidelines for creating interaction diagrams:
Today we will look at sequence diagrams Tomorrow we will look at communication diagrams
Reference: Text Ch 7
3
Interaction Diagrams
Sequence and communication diagrams represent how objects collaborate to support business processes portrayed by use cases
4
Sequence Diagrams
Sequence diagrams illustrate the objects that participate in a Use Case
Show the messages that pass between objects over time for a particular Use Case
Typically one sequence diagram is produced for each scenario in a use case may sometimes produce a sequence diagram showing all possible
scenarios.
5
Sequence Diagrams
Elements of a sequence diagram:
Actors & Objects
Lifeline – represents time passing
Sometimes an object creates a temporary object - an “X” is placed at the point in the lifeline that the object is destroyed, e.g. shopping cart.
Execution occurrence – overlaid onto an object’s lifeline to show when the object is activated
6
Sequence Diagrams
Elements of a sequence diagram (continued): Message – a communication between objects.
Types (used in sequence diagrams): Operation call message Return message Note: unless a return message
adds information, it should be omitted
Sequence – order of messages is top to bottom
Conditions [ ] – message is sent only if condition is true, e.g. [aPatient Exists] LookupBills () where “aPatient” represents an object of the Class Patient
Session 2, 2010 10
Sequence Diagram - Rent Movie
find customer()search (string)
search (string)
add(Cust, item)
enter movie()
rent (movie)
printInvoice() generateRentalTotal()
Object
Lifeline
ActivationMessage
:CheckoutMgr :Inventory:Customer :RentedItems:Employee
The notation “:Inventory” means an anonymous object of class Inventory.
Session 2, 2010 11
Sequence Diagram: Places Order Use case
These “temporary” objects can now cease to exist
12
Sequence Diagrams versus Class Diagrams
The messages identified in your Sequence Diagram, then become operations in the Class Diagram.
If the aCustomer:Customer object sends a message “createSR()” to the aSR:SearchRequest object then the class SearchRequest should have an operation createSR()
Note that the requested operation belongs to the recipient of the message.
Session 2, 2010 13
Customer
studentIDname
updateAddress(). . . . .
Sequence Diagram and Class Diagram Example
searchRequest
searchNosearchTerm. . . . .
createSR() . . . .
1..1 0..*
requests
Message from Sequence Diagram becomes an operation in the Class Diagram. Operation belongs with the recipient of the message.