Presentation is loading. Please wait.

Presentation is loading. Please wait.

Week 10 1 Sequence Diagrams. Outline a)Add scenarios to the system to describe how Use Cases are realized as interactions among societies of objects b)Describe.

Similar presentations


Presentation on theme: "Week 10 1 Sequence Diagrams. Outline a)Add scenarios to the system to describe how Use Cases are realized as interactions among societies of objects b)Describe."— Presentation transcript:

1 Week 10 1 Sequence Diagrams

2 Outline a)Add scenarios to the system to describe how Use Cases are realized as interactions among societies of objects b)Describe a scenario by applying sequence diagrams c) Draw Sequence diagrams for given case studies 2

3 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 4 : Patient aPatient :Patient 1: enquiresAvailability Patient Checks Availability of Doctor The Actor Object Time Line Message Self Message Focus of Control Steps in the Sequence Notes

5 How do you start? 1.Identify the process/algorithm/activity you want to capture( may be a use case) 2.Identify the major objects involved 3.Map out the flow of control/ messages to achieve the result

6 Relating Sequence Diagrams to Class Diagrams 6 aPatient: Patient 1: checkPatientDetails ( ) Patient checkPatientDetails( ) Objects on Sequence Diagrams belong to Classes in Class Diagram Messages on Sequence Diagrams come from Methods available to the Class on Class Diagrams

7 A Layered Architecture Subsystems are shown as UML packages linked by dependencies A dependency without a stereotype means uses 7

8 Advancing the Sequence Diagrams from Analysis to Design: Showing specific objects (A) Analysis Sequence Diagram Read “System” (B) Design Sequence Diagram Shows “Doctor” – a Specific object 8

9 Representing objects

10 Message between objects

11 More on messages

12 Indicating method calls

13 Lifetime of objects

14 Understanding Focus of Control and return message aPatient : Patient : Doctor getSchedule( ) getAvailable( ) availability Focus of Control Return Protocol 14

15 Creating and Destroying an Object : PatientForm aPatient : Patient bookConsultation( ) “Creating an Object” Shown with the arrow pointing directly to the Object “Deleting an Object” Shown with a Cross on the Timeline 15

16

17

18

19 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

21

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)

23

24 24 Use Case: Have Dinner Scope:Restaurant 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.aCustomer asks the waiter for his or her name. Restaurant Example

25 25

26 26

27 27 A sequence diagram fragment that contain an alternative combination fragment

28 28 A sequence diagram with a loop combination fragment

29 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.aPatient is not on file. Create new patient. (Extend: 141 - Create Patient.)

30 30

31 31 UML Extension Mechanisms UML offers a set of mechanisms that allow modeling to be refined, extended and adapted to specific needs. Stereotyping Stereotyping is the specialization of standard UML notations.

32 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.

33 33

34 34

35 35

36 END 36


Download ppt "Week 10 1 Sequence Diagrams. Outline a)Add scenarios to the system to describe how Use Cases are realized as interactions among societies of objects b)Describe."

Similar presentations


Ads by Google