UML Interaction modeling using OSDs - PowerPoint PPT Presentation

1 / 20
About This Presentation
Title:

UML Interaction modeling using OSDs

Description:

... review a Hotel booking example problem ... when a visitor enters the hotel. ... Hotel Example - Class diagram further developed inheritance. Persons ... – PowerPoint PPT presentation

Number of Views:49
Avg rating:3.0/5.0
Slides: 21
Provided by: Staffordsh75
Category:

less

Transcript and Presenter's Notes

Title: UML Interaction modeling using OSDs


1
UML - Interaction modeling using OSDs
  • Format of lecture
  • Over Last 2 week Ive introduced dynamic modeling
    to you in in the form of State Diagrams
  • This week we continue this theme with a new
    diagram to consider called an Object Sequence
    Diagram (OSD)
  • Object Interaction is also dynamic behaviour
    modeling
  • It is used to show the interactions which occur
    between the static Class Diagram and the Use
    Cases
  • Why useful?
  • This integration of the users view (Use Case
    model) and the developers view(Class Diagram) is
    used to cross check the requirements of the
    system
  • There will be a demo of an OSD using Visio
  • This week is just the intro followed by more next
    week

2
Interaction modeling
  • As we have seen and used.
  • The Class Diagram for a problem defines the
    internal structure of the objects (by defining
    the class content) but does not show how the
    objects will interact
  • Use Cases depict the processes without concern
    for the internal composition of the processes
  • Interaction modeling increases the chances of the
    system achieving what the user wanted

3
Interaction modeling
  • Object interaction modeling involves two types of
    modeling diagram derived from Use Cases
  • Object Sequence Diagram(OSDs)
  • Object Collaboration Diagram(OCDs)
  • We are just following OSDs

4
Object Sequence Diagram
  • Illustrate how objects interact with each other
  • Focuses on message sequence

Part of an OSD
5
Object Messages
  • Messages are fundamental to OO see first weeks
    lecture but to recap
  • What is a message?
  • a communication between objects that conveys
    information
  • has a sender and recipient(analogy with client
    and server)
  • is represented as an arrow denoting flow of
    control

6
Object Sequence Diagram
  • The Object Sequence Diagram(OSD) represents a
    graphic description of a Use Case - this is
    useful
  • It has description constructs of sequence,
    selection and iteration
  • passage of time also depicted on the diagram by
    the flow of messages
  • So it does the things the Use Case Diagram could
    not
  • Why use them?
  • As developer we can look at the OSD to see what
    objects(derived from Classes) make up a process(a
    transaction) and the sequence of how they are
    used.
  • Let us briefly review a Hotel booking example
    problem

7
Hotel System Example - Use-case view
  • Hotel UCD

8
Hotel System Example - Use Cases
  • Check_in use case
  • This use case begins when a visitor enters the
    hotel.
  • The system checks if the visitor had booked a
    room.
  • If yes then the S1. If not the system checks if
    there are free rooms. If yes the room is reserved
    for the visitor and the S1. If not the case is
    finished with the message - NO Vacancies.
  • S1. Room is allocated to the visitor. Message
    GIVE KEY is send to the receptionist. The visitor
    receives a VISITORS CARD.
  • Check_out use case
  • This use case begins when a visitor arrives at
    the reception desk in order to check out the
    hotel.
  • The system calculates the bill. The visitor pays.
    The system sends a message to the cleaner to
    clean up the left room. COLLECT KEY is send to
    the receptionist. The visitor returns the key the
    visitors card.

9
Classes identified
  • Hotel
  • Hotel has one or more Hotel Guest
  • Hotel has many Rooms
  • Hotel has employees - Receptionist and Cleaner

10
Hotel System Example - Class Diagram initial
Hotel
available (r Room)
1
1
guests
Room
Cleaner


HotelGuest
size Number
pay Money
clean Bool
leave ()
clean (r Room)
11
Hotel Example - Class diagram further developed
inheritance
  • Persons involved

Need to put Room Class on here as well
12
Hotel Example - State Diagram
  • Room class chosen to be modelled

13
Hotel Example Object Sequence Diagram
14
Sequence Diagram
  • Purpose
  • capture the behaviour of a single use case -
    how messages are sent within a use case
  • show how objects interact with each other - show
    how they send and receive messages
  • focus on time
  • Syntax
  • object
  • time
  • message
  • Forms
  • generic - all possible alternative scenarios
  • instance - one scenario, no conditions, branches,
    loops

15
Object Sequence Diagram
  • Making a
  • telephone
  • call Use Case
  • example

16
Sequence Diagram
  • Types of messages
  • simple
  • flat flow of control - control is passed without
    describing any details
  • synchronous
  • nested flow of control - operation call
  • handling of the message is completed before the
    caller resumes execution
  • asynchronous
  • there is no explicit return to the caller
  • the sender continues to execute after sending the
    message without waiting for it to be handled

17
Sequence Diagram
  • Activation
  • time during which object performs an action
    either directly or through another object
    (subcontractor)
  • Return
  • implicit
  • explicit

18
Sequence Diagram
  • Purpose
  • capture the behaviour of a single use case -
    how messages are sent within a use case
  • show how objects interact with each other - show
    how they send and receive messages
  • focus on time
  • Syntax
  • object
  • time
  • message

19
Tutorial - To create OSDs
  • Select a Use Case (Use Case Script) to be
    modelled
  • From UCD script description you have the
    Sequence, Select and Iteration
  • Draw Classes onto OSD diagram along the top
  • Add messages to the diagram
  • Remember TIME runs vertically downwards
  • Do an initial draft first and then think about
    refining it

20
For the Assignment
  • You have all the things necessary to make one
    OSD
  • Use Cases from the Use Case Diagram work
  • Use Case Scripts
  • Business Classes (and Interface Classes) from the
    Class Diagram work
  • Re messages and the Operation/Events from the
    Class Diagram work and State Diagram work
  • More next week in the consolidation session about
    how to build one
Write a Comment
User Comments (0)
About PowerShow.com