Documente Academic
Documente Profesional
Documente Cultură
Agenda
Understand the rules and style guidelines for
sequence diagram
Understand the processes used to create
sequence diagram
Sequence Diagrams
Visualize how actors participate in an use
case and how messages trigger methods
of different classes in sequence
One sequence diagram usually shows a
single scenario of a use case
Must be consistent with the underlying
use case and class diagram
Note: Sequence diagram can include important messages transmitted
between actors
3
Receptionist
Patient
Unpaid Bill
Appointment
Lookup_Patient()
Lookup_Bills()
Timeslot Inquiry
Appointment Timeslot
Search_Appointment_Timeslot()
Insert_Appointment()
Confirmation
4
Member
Reservation
Administrator
login()
request for
resident card
resident card
scan/retrieve()
viewReservation
Detail()
confirmation of
reservation
acknowledgement
updateStatus()
notification after
using the facility
updateStatus()
logoff()
7
Class Diagram
Whole System
STUDENT
STU_ID
STU_LName
STU_FName
STU_Uid
STU_Pwd
Creates/created by
SERVICE_STAFF
SRV_StaffID
SRV_LastName
SRV_FirstName
SRV_Username
SRV_Password
Login ()
Logout()
Login()
Logout()
OWNER
OWN_ID (Email)
OWN_LName
OWN_FName
OWN_Phone
Sequence Diagram
0..*
owns/is owned by
1
Insert_Owner()
Read_Contact()
0..10
SHORTLISTING_RECORD
SR_ID
SR_STU_ID
SR_APT_ID
SR_Date
SR_Status
Add_Record()
Delete_Record()
Update_Status()
Retrieve_List()
1..*
Includes/is included in
1
APARTMENT
APT_ID
APT_Loc
APT_Bedroom
APT_Rent
APT_PostingDate
APT_OWN_ID
Insert_Apartment()
Email_Owner()
Delete_Apartment()
Match_Search_Criteria()
Agenda
Understand the rules and style guidelines for
sequence diagram
Understand the processes used to create
sequence diagram
3. Add messages
Use Cases
UC-004
Handle Reservations
Actors
Administrator
Member
1
1
Exercise #1
Student
UC-200
Add
Apartment
Service Staff
UC-300
Delete
Apartment
Owner
IUC-001
Validate
Login
EUC-001
Shortlist
Apartment
12
Class Diagram
STUDENT
STU_ID
STU_LName
STU_FName
STU_Uid
STU_Pwd
Creates/created by
1
SERVICE_STAFF
SRV_StaffID
SRV_LastName
SRV_FirstName
SRV_Username
SRV_Password
Login ()
Logout()
Login()
Logout()
OWNER
OWN_ID
OWN_LName
OWN_FName
OWN_Phone
OWN_Email
Insert_Owner()
Read_Contact()
0..10
0..*
Includes/is included in
owns/is owned by
1
SHORTLISTING_RECORD
SR_ID
SR_STU_ID
SR_APT_ID
SR_Date
SR_Status
Retrieve_List()
Add_Record()
Delete_Record()
Update_Status()
1..*
1
APARTMENT
APT_ID
APT_Loc
APT_Bedroom
APT_Rent
APT_PostingDate
APT_OWN_ID
Insert_Apartment()
Email_Owner()
Match_Search_Criteria()
Delete_Apartment()
13
8.
9.
10.
14
IUC-001
Use Case
Validate Login
Description
Including Use
Cases
Flow of Events
1.
2.
3.
4.
Alternative Flows
NA
Priority
High
Non-Functional
Requirements
NA
Assumptions
NA
15
EUC-001
Use Case
Shortlist Apartment
Actors
(P) Student
Description
Flow of Events
Alternative Flows
NA
Priority
Low
Non-Functional
Requirements
Assumptions
NA
16
Student
Apartment
Owner
Login()
Match_Search_Criteria()
Read_Contact()
Logout()
17
Actors
Student
Student
Apartment
Owner
Login()
Match_Search_Criteria()
Read_Contact()
Logout()
18
6.
7.
8.
9.
10.
11.
12.
13.
14.
Owner
Service Staff
Service_Staff
Owner
Apartment
Login()
Read_Contact()
Insert_Apartment()
Email_Owner()
Read_Contact()
Email_Notification
Logout()
20
Actors
Add Apartment
Owner
Service Staff
Owner
Service Staff
Service_Staff
Owner
Apartment
Login()
Read_Contact()
Insert_Apartment()
Email_Owner()
Read_Contact()
Email_Notification
Logout()
21
22
Service Staff
Service_Staff
Owner
Apartment
Shortlisting_
Record
Login()
Read_Contact()
Delete_Apartment()
Update_Status()
Read_Contact()
Email_Owner()
Email_Notification
Logout()
23
Actors
Delete Apartment
Owner
Owner
Service Staff
Service Staff
: login(), logout()
: Read_Contact()
: Delete_Apartment()
Email_Owner()
Shortlisting_Record: Update_Status()
Service_Staff
Owner
Apartment
Shortlisting_
Record
Login()
Read_Contact()
Delete_Apartment()
Update_Status()
Read_Contact()
Email_Notification
Email_Owner()
Logout()
24
The enclosing method starts or calls the enclosed method. The initiator of the
enclosed method thus is the owner of the enclosing method.
A sequence of
instructions
Delete_Apartment()
{
Update_Status()
Email_Owner()
Update_Status()
{
Read_Contact()
{
Email_Owner()
{
}
Read_Contact()
}
A simple rule that works generally well: use the recipient of the last method as the
25
initiator of the current method.
Summary
After todays class, you should
Be able to create sequence diagrams based on use
cases and class diagrams
26
Next Class
Behavioral state machine diagram
Reading:
Textbook Ch. 6
27