You are on page 1of 13

OBJECT-ORIENTED MODELLING (OOM) - 32536

Module 4
Sequence & Collaboration Diagram; Interaction Overview Diagram; (POOA- Chapter 7; POOD Chapter 4)

"Copyright Practical OO Analysis, Thomson Publishing, 2005".

Module Outline
Major Ingredients of Sequence Diagram Importance and Relevance of Sequence Diagram in Analysis Interaction Overview Diagrams

"Copyright Practical OO Analysis, Thomson Publishing, 2005".

Interaction diagrams
Interaction Diagram

Collaboration Diagram

Sequence/Fence Diagram

"Copyright Practical OO Analysis, Thomson Publishing, 2005".

Major Ingredients of a Sequence Diagram


1: enquiresAvailability

Message

The Actor
: Patient

Self Message

aPatient :Patient

Object

Focus of Control

Time Line
Patient Checks Availability of Doctor

Steps in the Sequence Notes

T hi s is a n
exp l n a t r n o t a o y e

"Copyright Practical OO Analysis, Thomson Publishing, 2005".

Sequence diagram
Dynamic interactions between collaborating objects in the system Represent a scenario in the system Show a set of collaborating objects, messages passing between them, and timing

"Copyright Practical OO Analysis, Thomson Publishing, 2005".

A Basic Sequence Diagram


: A c tor P ati ent aDoc tor : Doc tor

: ActorPatient

System

checkAvailability()

c hec k A vailability ( )

Sequence Diagrams show the instance level Sequence of Interactions between Objects, System and, occasionally, Actors
"Copyright Practical OO Analysis, Thomson Publishing, 2005". 6

Sub-module
Sequence diagrams for hospital management system

"Copyright Practical OO Analysis, Thomson Publishing, 2005".

Registering a Patient Sequence Diagram

: ActorPatient

: Administrator

System

GHRS

AnnounceArrival()

ProvideDetails()

This is a hypothetical object meant to represent actor system interaction. Real objects will replace the system object shown here in detailed diagrams Ent erDet ails() VerifyDetails() Separate Sequence Diagrams will apply if Insufficient Details are provided by Patients

VerifyMedicalInsuranceDet ails()

CreatePatientRecord() CreatePatientRecordID()

"Copyright Practical OO Analysis, Thomson Publishing, 2005".

Updating a Calendar Sequence Diagram


: Staff ShowCalendar() GetCalendar() aInterface aCalendar : Calendar

EnterRosterDetails() VerifyCalendar() Separate Sequence diagrams need to be created if there are conflicting Rosters UpdateCalendar()

ValidateRosterDetails()

AcceptedRosterDetails()

"Copyright Practical OO Analysis, Thomson Publishing, 2005".

Booking a Consultation Sequence Diagram


: ActorPatient aInt erface :Physician : Calendar SpecifyInitialConsultationDetails()

ProvidePhysicianList()

Select Physician() Get AvailableDate&Time()

Calendar is separately updated by Doctor (Staff) in terms of their availability

SelectDate&Time() UpdateCalendar()

ConfirmDate&Time()

"Copyright Practical OO Analysis, Thomson Publishing, 2005".

10

Paying a Bill Sequence Diagram


: ActorPatient : BPay : Bill

displayPayment( )

Veirfy BpayStat ement()

acceptPayment( ) UpdateBill( )

GenerateReceipt() ConfirmReceipt()

"Copyright Practical OO Analysis, Thomson Publishing, 2005".

11

Objects on Sequence Diagrams belong to Classes in Class Diagram

Relating Sequence Diagrams to Class Diagrams


Patient

aPatient: Patient

1: checkPatientDetails( )

checkPatientDetails( )

Messages on Sequence Diagrams come from Methods available to the Class on Class Diagrams
"Copyright Practical OO Analysis, Thomson Publishing, 2005". 12

Collaboration diagrams
documents main interactions and in particular their sequences where needed a.k.a. object diagram or Event Model use primarily Sequential Messages and possibly Exception flows
"Copyright Practical OO Analysis, Thomson Publishing, 2005". 13

links not associations

:Driver
1: startEngine, 4: pressAccelerator, 5: turnSteeringWheel

whereas Collaboration diagrams emphasize the local architecture

:Car

2: switchBatteryOn

:Door :Engine 3: lockDoor


"Copyright Practical OO Analysis, Thomson Publishing, 2005". 14

Example Collaboration Diagram


action()

1 1.2 1.1

1.3

"Copyright Practical OO Analysis, Thomson Publishing, 2005".

15

Sub Module
Interaction Overview Diagrams

"Copyright Practical OO Analysis, Thomson Publishing, 2005".

16

Ingredients of an Interaction Overview Diagram


Start Stop Reference (to a Use Case or a Sequence Diagram ) Flow

ref

EnquirySequence

Fork / Join

Note Decision

"Copyright Practical OO Analysis, Thomson Publishing, 2005".

17

Sub-module
Interaction overview diagrams for hospital management system

"Copyright Practical OO Analysis, Thomson Publishing, 2005".

18

Consultation Details Interaction Overview Diagram (V2)


ref

ChecksCalendar NO "BookingAvailable?" YES Check the Calendar again for Alternatives. If no bookings available, no consultation takes place
ref

BooksConsultation

ref

ExaminesPatient

OrdersTests Interaction Overview Diagrams reference Sequence diagrams or Use cases, providing an overview of flow "Copyright Practical OO Analysis, between them.

ref

re f

WritesPrescriptions

19

Thomson Publishing, 2005".

Accounting Interaction Overview Diagram


re f

PaysBill

Method CashCheque CARD


re f r e f

BPAY
r e f

PaysBillByCard

PaysBillOnInternetBPAY

CashChequePayment

Private?

YES
r e f

NO

PlacesInsuranceClaim

"Copyright Practical OO Analysis, Thomson Publishing, 2005".

20

10

Workbook Exercises
For The Class Room!!

"Copyright Practical OO Analysis, Thomson Publishing, 2005".

21

Workbook Exercises
1. Draw a sequence diagram to show instance-level behaviour from one of your earlier use cases in chapter 4 (check the documentation of that use case to draw the sequence diagram) 2. Draw a sequence diagram to show dynamic behaviour from an activity diagram documented by you in Chapter 5 3. Identify a few operations from the above exercise in drawing sequence diagrams; that were not described in the corresponding classes. Update the classes with those operations.
"Copyright Practical OO Analysis, Thomson Publishing, 2005". 22

11

Workbook Exercises
4. Observe if you are able to identify any new classes as a result of drawing the sequence diagrams. 5. Identify a Use case diagram in Chapter 5. Draw an Interaction Overview Diagram corresponding to that use case diagram.

"Copyright Practical OO Analysis, Thomson Publishing, 2005".

23

Conclusions
Sequence diagrams in
Interaction between Collaborating Objects Interaction between Actors and System.

Naming an interaction overview diagram

"Copyright Practical OO Analysis, Thomson Publishing, 2005".

24

12

Project Work :
(During Tutorials in the Lab);
the Project Work Requirements given at the End of the Chapter; Discuss Project Work with Team Members and Tutor; Carry Out the Project Work
Follow
"Copyright Practical OO Analysis, Thomson Publishing, 2005". 25

13

You might also like