Lecture 2b UML
References
Textbook Chapter 2
Object Oriented Analysis, 300144 1
About UML
• History of UML
• UML usage today
• UML –based project type and size
Refer to textbook Page 23~26 for more details
UML 2.0 Diagrams and Purpose
UML diagrams
Represent the…
Use case
functionality from user’s viewpoint
Activity
the flow – within a use case or the system
Class
Classes, entities, business domain database
Sequence
the interactions between objects
Interaction Overview
interactions at a general high-level
Communication
the interactions between objects
Object
objects and their links
State Chart
the run-time lifecycle of an object
Composite Structure
Class behavior at run-time
Component
the executables, linkable libraries etc.
Deployment
the hardware nodes and processors
Package
Subsystems, organizational units
Timing
time concept during object interactions
Object Oriented Analysis, 300144 3
Use Case Diagram
ChecksDoctorAvailability
:
SchedulesConsultation
ActorPatient
ActorStaff
Nature: Static-Behavioural
Use Case diagrams provide an overview of Actors, Use cases and their interaction. Use cases document Interactions between the Actor and the System.
Object Oriented Analysis, 300144 4
Provides administrative support. Not required for internet schedulings.
Use Case Diagram
ChecksDoctorAvailability
Use Case
SchedulesConsultation
:
ActorPatient
ActorStaff
Nature: Static-Behavioural
Use Case diagrams provide an overview of Actors, Use cases and their interaction. Use cases document Interactions between the Actor and the System.
Provides administrative support. Not required for internet schedulings.
Object Oriented Analysis, 300144 5
Use Case Diagram
Use Case Diagram
ChecksDoctorAvailability
:
SchedulesConsultation
ActorPatient
ActorStaff
Nature: Static-Behavioural
Use Case diagrams provide an overview of Actors, Use cases and their interaction. Use cases document Interactions between the Actor and the System.
Provides administrative support. Not required for internet schedulings.
Object Oriented Analysis, 300144 6
Use Case Diagram – Summary
• Use case diagrams are primarily used to visualise the user cases, corresponding actors and their interactions
→ a model of the requirements of the system at a high level
→ visual models of use cases facilitate understanding the business processes and can aid in communication.
• Usecasediagramsarestatic-behavioural→most helpful in their organising and scoping the requirement (capturing the behavioural aspect of the requirements)
Object Oriented Analysis, 300144 7
• Show any flow (or process) in the system
This is for Pre-registered or known Patients
Activity Diagram
EnquiresAvailability
No
AvailabilityNoted
ChecksCalendar
SpecifiesAvailability
MoreOptions?
Activity Diagrams depicts Flow within and between Use Cases; Multithreads can be Shown
Patient
System
Yes
Nature: Static- Behavioural
Object Oriented Analysis, 300144
8
Activity Diagram
• Show a flow of activities
• Used to model processes: •At the business process level
•With a use case •Between use cases
•Like flowcharts
•Activities can be either at a detailed technical level or at a business level
•Purpose: effectively
document the behaviours •Capable of visually modelling and demonstrating the flow of a use case
•Show dependency between activities
•Able to show multiple threads
This is for Pre-registered or known Patients
9
Patient
System
EnquiresAvailability
No
AvailabilityNoted
ChecksCalendar
SpecifiesAvailability
MoreOptions?
Yes
Class Diagram
Show business-level and technical classes and the relationships between the classes
Check ActorPatient for Business Rules
Class diagrams model Classes and their relationships. Classes are Templates that define a collection of objects with common properties, behaviour and relationships.
Nature: Static-Structural
Patient
Physician
Doctor
Surgeon
Object Oriented Analysis, 300144 10
Sequence Diagram
Roy : ActorPatient
CheckAvailability( )
Sue : Doctor
CheckSchedule( )
Nature: Dynamic-Behavioural
Sequence Diagrams show the instance level Sequence of Interactions between Objects, System and, occasionally, Actors
Object Oriented Analysis, 300144 11
: Calendar
→ ability to show what is happening inside a use case
→ popular to business analysts and system designers
Roy : ActorPatient
CheckAvailability( )
Sequence Diagram
CheckSchedule( )
Nature: Dynamic-Behavioural
Sequence Diagrams show the instance level Sequence of Interactions between Objects, System and, occasionally, Actors
Object Oriented Analysis, 300144
12
Sue : Doctor
: Calendar
→show interaction between actors and the system, actors and objects and between collaborating objects (within a time block)
→messages might have pre-conditions and post- conditions, the conditions not visible on the diagram
Roy : ActorPatient
CheckAvailability( )
Sequence Diagram
CheckSchedule( )
Nature: Dynamic-Behavioural
Sequence Diagrams show the instance level Sequence of Interactions between Objects, System and, occasionally, Actors
Object Oriented Analysis, 300144
13
Sue : Doctor
: Calendar
Interaction Overview Diagram
Interaction Overview Diagrams reference Sequence diagrams or Use cases, providing an overview of flow between them.
NO
Nature: Static- Behavioural
ref ChecksDoctorAvailability
Acceptable? YES
ref ScheduleConsultation
This is where the Consultation with a specific Doctor is booked by the Patient
Object Oriented Analysis, 300144 14
Show a suite of collaborating objects and how they are related through their messages and the sequence of those diagram
1: CheckAvailability( )
Communication Diagram
Roy : ActorPatient
Sue : Doctor
2: CheckSchedule( )
: Calendar
Nature: Dynamic-Behavioural
Communication Diagrams model interactions organized around the objects and their links to each other. They provide alternative view of the Sequence Diagrams
Object Oriented Analysis, 300144 15
Object Diagram
John: Patient
Mary: Patient
Roy: Patient
aDoctor
Nature: Dynamic-Structural
Describes the various Objects (instances) and how they relate to each other. The relationships are links in the memory.
Object Oriented Analysis, 300144 16
State Machine Diagram
Available
bookAppointment() [AppointmentBooked]
States for Doctor Object
Nature: Dynamic-Behavioural
Booked [StartConsulting] Consulting
Depicts the State of an Object; And the Events that Effectuate a Change in State;
Object Oriented Analysis, 300144 17
Composite Structure Diagram
ScheduleForm
Calendar
<
Composite structure diagrams show links and decompositions of run-time components / objects.
Nature: Dynamic-Structural
Object Oriented Analysis, 300144 18
Component Diagram
Pictorial representation of the final executable and linked
libraries
Doctor Calendar
Nature: Static-Structural
A diagram that shows the composition, organization and dependencies among software components.
Object Oriented Analysis, 300144 19
Deployment Diagram
Patients access the Hospital Server
Hospital Server
Printer
Patient1 .exe
Nature: Static-Structural
Deployment Diagram: A diagram showing how the system will be deployed in operation: It shows processes and nodes in the physical design of a system.
Patient2 .exe
Object Oriented Analysis, 300144 20
Package Diagram
Staff
Calendar
Packages represent sub- systems; They comprise large and cohesive collection of other UML diagrams. Package diagrams show Packages and their dependencies.
Nature: Static-Structural
Object Oriented Analysis, 300144 21
Timing Diagram
Operating: ON State
Doctor
{80 mins}
Not Operating: OFF State
Timing Diagram show one or more Objects and their states. The time constraints are also shown on this diagram.
Nature: Dynamic-Behavioural
Object Oriented Analysis, 300144
22
UML diagrams and Modelling Spaces
UML diagrams
MOPS (Business
Analyst)
MOSS (Designer)
MOBS (Architect)
Use case
*****
**
*
Activity
*****
**
*
Class
***
*****
**
Sequence
****
*****
*
Interaction Overview
****
**
**
Communication
*
***
*
Object
*
*****
***
State chart
***
****
**
Composite Structure
*
*****
****
Component
*
***
*****
Deployment
**
**
*****
Package
***
**
****
Timing
*
***
*****