Sei sulla pagina 1di 26

UML Modeling

d li

What is UML?

UML stands for Unified Modeling Language

It is a industry-standard graphical language for


specifying, visualizing, constructing, and documenting
th artifacts
the
tif t off software
ft
systems
t

The UML uses mostly graphical notations to express


the OO analysis and design of software projects.

Simplifies the complex process of software design

Whyy UML for Modeling


g

Use graphical notation to communicate more clearly


than natural language (imprecise) and code(too
detailed).
Help acquire an overall view of a system.
system
UML is not dependent on any one language or
technology.
UML moves us from fragmentation to standardization.

Types of UML Diagrams

Use Case Diagram

Class Diagram

Sequence Diagram and Activity Diagrams

Collaboration Diagram
g

Deployment Diagram

State Diagram

Use Case Diagram

Used for describing a set of user


scenarios
Mainly used for capturing user
requirements
i
t
Work like a contract between end user
and software developers

Use Case Diagrams

A set of ACTORS : roles users can p


playy in interacting
g with
the system.
An actor is used to represent something that uses our
system.
t
A set of USE CASES: each describes a possible kind of
interaction between an actor and the system.
Uses cases are actions that a user takes on a system
y
System
Sys
e bou
boundary:
d y: rectangle
ec g e diagram
d g
representing
ep ese
g thee boundary
bou d y be
between
wee
the actors and the system.

Use Case Diagrams - Actors

An actor is a user of the system playing a particular


role.
Actor is shown with a stick figure.

employer

employee

client
li
7

Actors

An Actor is outside or external the system


system.
It can be a:

Human
Peripheral device (hardware)
External system or subsystem
Ti
Time
or time-based
i
b d event

Use Case Diagrams Use Cases

Use case is a particular activity a user can do on the


system.
Is represented by an ellipse.
Following are two use cases for a library system.

Borrow

Reserve

Use Case Diagrams


Use Case

B
Boundary
d
Actor

Library System

Borrow

Employee

Client

Order Title

Fine Remittance

Supervisor

Actors are stick figures.


figures
Use cases are ovals.
Communications are lines that link actors to use cases.

Finding Actors

Who or what will use the main functionalityy of the system?


y
Who or what will provide input to this system?
Who or what will use output from this system?
Who will need support from the system to do their work?
Are there any other software systems with which this one
needs
d to interact
Are there any hardware devices used or controlled by this
system?

11

Example Use Case Diagram

12

Use Cases
Here is a scenario for a medical clinic.

A patient calls the clinic to make an appointment for a yearly

checkup.
h k
The
Th receptionist
i i finds
fi d the
h nearest empty time
i
slot
l in
i
the appointment book and schedules the appointment for that
time slot. "

We wantt tto write


W
it a use case ffor thi
this scenario.
i
Remember: A use case is a summary of scenarios for a single
task or goal.

Use Cases

The actor is a Patient.

The Use Case is Make Appointment.


Appointment

It is a use case for the medical clinic.

Use Cases diagram

Use Case Diagram for Student


A
Assessment
tM
Managementt S
System
t
Grade system
Record
grades

Student
View grades

Teacher

Distribute
Report cards

Create report
cards

Printing administrator
16

Example Use Case Diagram - Univ


R i t ti S
Registration
System
t
URS
add member

system
user

del member
add subject

academic

del subject
assg subject
unass subject
enrol subject
unenrol subject

student
17

system name

ATM System

system boundary

1
Withd
Withdraw
Money

Bank
Customer

2
Deposit
Money

3
Transfer
Money
association

use case

4
Ch k
Check
Balance

Customer
Accounts
Database

Sub-use
Sub
use Case Diagram
ag a

<<extend>>

(1a)
Withd
Withdraw
from
f
Current

1
Withdraw
Money
Bank
Customer

<<extend>>

This is an extend dependency.


dependency
It indicates that use case (1b) is part of
use case 1, but it may or may not be
invoked.
invoked
The same is true of use case (1a).

(1b)
Withdraw from
Savings

Customer
Accounts
D b
Database

Sub-use
Sub
use Case Diagram
ag a
1a
Withd
Withdraw
from
f
Current
1
Withdraw
Money
Bank
Customer
1b
Withdraw from
Savings
generalization

Customer
Accounts
D b
Database

20

Sub-use
Sub
use Case Diagram
ag a

<<include>>

(3a)
S l t
Select
Accounts

3
Transfer
Money
Bank
Customer

<<include>>

This is an include dependency.


dependency

(3b)
Update Account
Balances

Customer
Accounts
D b
Database

It indicates that use case (3b) is included


in use case 3 and will be invoked.
The same is true of use case (3a).

21

Use Case Diagrams - Relationships

Inclusion

Extension

Inclusion enables to reuse one use case's steps inside


another use case.
case
Allows creating a new use case by adding steps to
existing use cases

Generalization

Allows child use cases to inherit behavior from parent


use cases

22

Use Case Modeling: Core Elements (Summary 1)


Construct Description
use case

actor

A sequence of actions, including


variants, that a system (or other
entity) can perform, interacting with
actors of the system
system.
A coherent set of roles that users
of use cases play when interacting
with these use cases.
cases

Syntax

UseCaseName

ActorName

system
boundary

Represents the boundary between


the physical system and the actors
who interact with the physical
system.

Use Case Modeling: Core Elements (Summary 2)


Construct

Description

The participation of an actor in a use


case. i.e.,
i
iinstance
t
off an actor
t and
d
instances of a use case communicate
with each other.
extend
t d
A relationship
l ti hi ffrom an extension
t i use
case to a base use case, specifying
how the behavior for the extension
use case can be inserted into the
behavior defined for the base use
case.
generalization A taxonomic relationship between a
more general use case and a more
specific use case.

Syntax

association

<<extend>>

Use Case Modeling: Core Elements (Summary 3)


Construct

Description

include

An relationship from a base use case


to an inclusion use case, specifying
how the behavior for the inclusion use
case is inserted into the behavior
defined for the base use case.

Syntax
<<include>>

From
o Use
U Case
a to
o Classes
a

26

Potrebbero piacerti anche