You are on page 1of 28

UML Diagrams

Use Case Diagram


Activity Diagram
Sequence Diagram
Collaboration Diagram
Class Diagram
State Transition Diagram
Component Diagram
Deployment Diagram

Use Case Diagram


These diagrams show the interaction
between use-cases and actors
A use case represents system
functionality, an actor represents the
people or systems that provide/receive
information from the system.
Show the overall functionality
of the system
Actors
Use cases

Use-Case Diagram
Use-case diagrams are created to
visualize the interaction of your system
with the outside world.
Request Course Roster
Professor

Student
Register for Courses

Billing System

Maintain Course Information


Registrar

Activity Diagram
An activity diagram shows the flow of
events within our
system.
Create
curriculum

Select courses
to teach

Create
catalog

Place catalog
in bookstore

Mail catalog
to students

Open
registration

[ Registration time period expired ]


Close
registration

Sequence Diagrams
These diagrams are used to show the
flow of functionality thru a use case.
Any actors involved are shown at the top
of the diagram, the objects are also
shown at the top
Sequence diagrams
display objects
not classes.

Sequence Diagram
A sequence diagram shows step by
step what must happen to accomplish a
piece of functionality provided by the
system.
: Student

registration
form

registration
manager

math 101

math 101
section 1

1: fill in info
2: submit
3: add Joe to Math 101
4: add Joe
5: are you open?
6: add Joe

Collaboration Diagram
These show exactly the same information
as the sequence diagrams but in a different
way and with a different purpose
Seq. diagrams represent object/actor
interactions over time, collaboration
diagrams show that w/o reference to time.

Collaboration Diagrams

Collaboration Diagram
A collaboration diagram displays object
interactions organized around objects
and their links to one another.
1: set course info
2: process

course form :
CourseForm

3: add course

: Registrar

theManager :
CurriculumManager

aCourse :
Course
4: new course

Class Diagram
Show the interaction between classes in
the system.
Each class on a Class Diagram is
represented by a rectangle divided into
three sections showing class name,
attributes , operations.
The lines show the
communications between
the classes
Class Diagrams

Class Diagram
A class diagram shows the structure of
your software.
ScheduleAlgorithm

RegistrationForm
0..*

1 RegistrationManager
addStudent(Course, Student)

1
RegistrationUser
name

Student

Course
name
0..* numberCredits
open()

addStudent(StudentInfo)

major

1
3..10
Professor
tenureStatus

1..*
4 CourseOffering
location
0..4
open()

addStudent(Student)

State Transition Diagram


State transition diagrams provide a way to
model to the various states in which an object
can exist.
These are used to model the more dynamic
behavior of a system ie: the behavior of an
object.
Ex: a bank account can exist in various states
Open , Closed, Overdrawn
There is a Start state indicating the state
that an object is in when it is first created and
a Stop state shows what state object is in
just before it is destroyed.

State transition Diagram


A state transition diagram shows the
lifecycle of a single class.
Add student[ count < 10 ]
Initialization

Add Student /
Set count = 0

do: Initialize course

Open
entry: Register student
exit: Increment count

Cancel
Cancel

[ count = 10 ]

Canceled
do: Notify registered
students

Cancel

Closed
do: Finalize course

Component Diagram
Component diagrams show you a
physical view of your model ie: the
software components and relationships
between them.
Two types of components executable
components and code libraries.

Component Diagram
Component diagrams illustrate the
organization and dependencies among
software components.
Register.exe

Billing.exe
Billing
System

People.dll
User

Course.dll
Course

Deployment Diagram
Deployment diagrams show you the
physical layout of the network and
where the various components will
reside.
Used by project managers, users,
architects and deployment staff to
understand the physical layout of the
system.

Deployment Diagram
The deployment diagram visualizes the
distribution of components across the
enterprise.
Registration

Database

Main
Building

Library

Dorm

Use Case Diagram


View Report Card

Student
Register for Courses

Course Catalog

Maintain Professor Information

Login
Maintain Student Information
Select Courses to Teach
Registrar
Professor
Close Registration

Submit Grades

Billing System

A use-case diagram can be modeled in


a number of ways.

(from List Property)

(from Maintain Profile)

Relationships
A relationship illustrates a connection
between two or more actors and use
cases
and between two or more use cases.
In the UML, an association relationship
is
represented by a solid line with or
without
an arrow. Association Relationships

Relationships
UML supports several types of
relationships. These include
Communication relationships
Uses/Includes relationships
Extends relationships
Actor Generalization relationships

Communication Relationships
This is a relationship between a use case
and a actor. These are diagrammed using
an arrow.
The arrowhead indicates who initiates the
communication.

Uses Relationship
A uses relationship allows one use case to
use the functionality provided by another
use case.
These are used to model some reusable
functionality that is common to two or
more use cases.
These are shown in UML with an arrow
and the word <<uses>>

Extends Relationship
An Extends relationship allows one use
case to optionally extend the
functionality provided by another use
case.
The use case which provides the
extending/using functionality is the
ABSTRACT use case whereas the main
use case is the CONCRETE use case
These are shown in UML with an arrow
and the word <<extends>>

Actor Generalization Relation


This relation is used to show that several
actors have some commonality.
This relation is only necessary if one type
of actor behaves differently from the other
as far as the system is concerned.
Ex: Corporate / Individual customer are
Concrete actors and a Customer is an
Abstract actor.

What Is a Flow of Events?


A flow of events is a textual description of
what the system does with regard to the
use case and is part of the use-case
specification.
In Rose, you include each use cases flow
of events in the Use-Case View.

Use-Case Flow of Events


Has one normal, basic flow
(Happy Path)
Several alternative flows

Regular

variants
Odd cases
Exceptional flows handling error situations
Happy Path

What Are Scenarios?


A scenario

is an instance of a use

case.
Scenarios make excellent test cases.

Use-Case Realization
Use-Case Model

Design Model

Use Case

Use-Case Realization

Sequence Diagrams

Use Case
Class Diagrams

Collaboration Diagrams