Download presentation
Presentation is loading. Please wait.
1
Sequence Diagrams Week 10
2
Outline Add scenarios to the system to describe how Use Cases are realized as interactions among societies of objects Describe a scenario by applying sequence diagrams c) Draw Sequence diagrams for given case studies
3
Sequence Diagram Sequence diagram represents the dynamic interaction between objects, or between actors and objects ordered in time. A sequence diagram is composed of a timeline, objects that interact across this timeline, and the messages that they exchange. Represent a scenario in the system
4
Major Ingredients of a Sequence Diagram
Major Ingredients of a Sequence Diagram : Patient 1: enquiresAvailability Message Self Message Focus of Control Steps in the Sequence Notes The Actor Object Time Line aPatient :Patient Patient Checks Availability of Doctor
5
How do you start? Identify the process/algorithm/activity you want to capture( may be a use case) Identify the major objects involved Map out the flow of control/ messages to achieve the result
6
Relating Sequence Diagrams to Class Diagrams
Relating Sequence Diagrams to Class Diagrams Objects on Sequence Diagrams belong to Classes in Class Diagram aPatient: Patient Patient 1: checkPatientDetails( ) checkPatientDetails( ) Messages on Sequence Diagrams come from Methods available to the Class on Class Diagrams
7
A Layered Architecture
A Layered Architecture Subsystems are shown as UML packages linked by dependencies A dependency without a stereotype means uses
8
Advancing the Sequence Diagrams from Analysis to Design: Showing specific objects (B) Design Sequence Diagram Shows “Doctor” – a Specific object (A) Analysis Sequence Diagram Read “System”
9
Representing objects
10
Message between objects
Message between objects
11
More on messages
12
Indicating method calls
Indicating method calls
13
Lifetime of objects
14
Understanding Focus of Control and return message
aPatient : : Doctor Patient getSchedule( ) Focus of Control getAvailable( ) availability Return Protocol
15
Creating and Destroying an Object
: PatientForm aPatient : “Creating an Object” Shown with the arrow pointing directly to the Object Patient bookConsultation( ) “Deleting an Object” Shown with a Cross on the Timeline
19
Manage course information
Manage course information The sequence of steps carried out in the "Manage course information" flow are: A user who is a course administrator invokes the manage course functionality. The manage course functionality of the course administrator invokes either the course creation or course modification functionality of a course. After the course is either created or modified, the manage topic functionality of the course administrator calls the topic creation or modification functionality of a topic. Finally, the user invokes the assign tutor to course functionality of the course administrator to assign a tutor to the selected course. Now, let us model these steps into a Sequence diagram for the "Manage course information" functionality.
20
the following use cases for the Courseware Management System were defined: View courses Manage topics for a course Manage course information View course calendar View tutors Manage tutor information Assign courses to tutors
22
Sketch a sequence diagram for the “normal” operation of an ATM (i.e. a customer inserts the card, enters his/her PIN, enters the amount, takes the card, and takes the money). The sequence diagram should show the interaction between the different components of the ATM. The ATM consists of the following components: screen keyboard card reader money tray money output device interface to banking server (for modifications of the account data of the customer)
24
Restaurant Example www.hndit.com Use Case: Have Dinner Scope:
Primary Actor: Customer Normal Flow: 1. Customer is seated at a table 2. Customer asks the waiter for the menu. 3. Customer orders drink(s). 4. Customer orders appetizer(s). 5. Customer orders main course(s). 6. Customer orders dessert(s). 7. Customer asks for the bill. 8. Customer pays the bill and receives change (if any). Alternate Flow / Exceptions: 1.a Customer asks the waiter for his or her name.
27
A sequence diagram fragment that contain an alternative combination fragment
28
A sequence diagram with a loop combination fragment
A sequence diagram with a loop combination fragment
29
Make Appointment Use Case-Analysis
Normal Flow: 1. Appointment clerk verifies that the needed medical service is provided by the hospital. 2. Appointment clerk records patient’s personal and contact data. 3. Appointment clerk records information about the referral source. 4. Appointment clerk consults hospital’s schedule to find a free slot for the required medical service. 5. Appointment clerk verifies that the patient is available for the appointment. Loop 1: Repeat steps 4-5 until hospital’s schedule matches patient’s availability. 6. Appointment clerk makes the appointment. Loop 2: Repeat steps 4-6 for each appointment. Alternate Flow/ Exceptions: 2.a Patient is not on file. Create new patient. (Extend: Create Patient.)
31
UML Extension Mechanisms
UML offers a set of mechanisms that allow modeling to be refined, extended and adapted to specific needs. Stereotyping is the specialization of standard UML notations.
32
UML Stereotyping UML stereotyping is typically simple but powerful: If any building block of UML is not specialized enough to express your specific needs, you may specialize it yourself by specifying a tag and/or assigning an icon.
36
end
Similar presentations
© 2025 SlidePlayer.com Inc.
All rights reserved.