Professional Documents
Culture Documents
(UML) Fundamentals
Aspects of the
development of a
commercial product
Creative Rational
• Intuitive • Logical
• Vague • Well defined
• Personalized • Impersonal
UML : Motivation
A Language
Some UML Notations
Notations Grammar
Process loan
Loan officer
Gr on
(Rat ady Bo aco
b s
io n a o J
l So ch Ive r
ftwa ss on)
k
re) UML (Eri
(Mid 90s)
James Rambaugh
(General Electric)
Building Blocks of UML
1 Class
2 Interface
3 Collaboration
4 Use Case
5 Active Class
6 Component
7 Node
Structural Thing 1 : Class
window
origin
size
open()
close()
move()
display()
Structural Thing 2 : Interface
IUnknown
Spelling.dll
ISpelling
Structural Thing 3 : Collaboration
Chain of
responsibility
Structural Thing 4 : Use Case
actor
Withdraw Money
Customer
Use case
Event Manager
Suspend()
Flush()
Structural Thing 6 : Component
Orderform.java
Structural Thing 7 : Node
Server
Behavioural ‘Things’
THINGS
1. Structural
2. Behavioural
3. Grouping
Behavioural things are the
4. Annotational
dynamic parts of the UML
model, representing behaviour
over time and space.
display
Behavioral Thing 2 : State
machine
A state machine is a behaviour
that specifies the sequence of
states an object or an interaction
goes through during its lifetime in
response to events, together with
its response to those events.
waiting
Grouping ‘Things’
THINGS
1. Structural
Grouping things are the
2. Behavioural organizational parts of the UML.
3. Grouping These are shown as packages.
4. Annotational Unlike components (which
exist at runtime) a package is
purely conceptual, meaning,
it only exits at development time.
Business rules
Annotational ‘Things’
THINGS
1. Structural Explanatory parts of
2. Behavioural UML models. These are
3. Grouping comments one may
4. Annotational apply to describe,
illuminate and remark
about any element in a
model.
Return copy of self
Building Blocks of UML
Bank Bank
Transaction Account
RELATIONSHIPS
1. Dependency
2. Association
3. Generalization
An association is a structural
4. Realization relationship that describes a set of
links, a link being a connection among
objects. Aggregation is a special kind
of association, representing a
structural relationship between a
whole and its parts.
Child Parent
RELATIONSHIPS
1. Dependency
2. Association Realization is a semantic relationship
3. Generalization between classifiers, wherein one
classifier specifies a contract that another
4. Realization classifier guarantees to carry out.
Refill Machine
Banker Shutdown
Why Use Cases ?
Use Case diagram is considered to be the
cornerstone of the UML. Because …
A human being
A mechanical object
Read card
Read PIN
Read amount
required
Withdraw Money
Customer
A secondary actor is an
A primary actor is the actor that plays a part
actor that receives the in, or supports in some
benefit of the use case. way, the Use Case.
Withdraw Money
Perform
Card Transaction
Report
Account Status
Customer Retail
Process Institution
Customer Bill
Reconcile
Transactions
Detect
Individual Corporate Card Fraud
Customer Customer
Sponsoring
Manage
Financial
Customer Account Institution
Generalization, Include, Extend
<<extend>>
Place Order Set Priorities
Place
Extension Point
Rush Order
Set Priority
<<include>>
Include
Relationship Validate
User Check
Trash <<include>>
Generalization
Order
Retinal Scam
Project Management Issue : How to Find Use Cases ?
Critical point
Problem:
Bid Plan
Index := lookup(e)+7
Process Bill
Action States
Do Construction
Activity States
Transitions
Start
State
Select Site
Action
State
Commission Architect
Triggerless
Transition
Stop
State
Branching
[materials ready]
Commission Architect
Branch
Forking & Joining
Decompress
Gestures()
Clearup
Activities performed by a petty
manager on his way to work
Swimlanes Sales
Customer Warehouse
Request product
Process order
Pull materials
Ship order
Pay bill
Close order
Object flow Customer Sales Warehouse
Process order
Pull materials
o:Order
Ship order
[in progress]
o:Order
Receive order Bill customer
[filled]
b:Bill
Pay bill [unpaid] Object
State
Close order
b:Bill
[paid]
Statechart Diagram
p)
m
Te
Too Cold (desired Temp)
d
rei
es
(d
At
p Event
ot
em
te
H
m
T
o
p
To
A
Initial State
Activating
Ready/turnOn()
Too Cool (desired Temp)
State
Active
transitions
Nested states
State Machine
for the
controller Initializing
in a home After (IO seconds)/ Self Test
security
system
Idle
Alarm(s)
Clear
Command Active
Checking
attention
Waiting
Calling
Entry/ setAlarm Entry 1
Exit / clearAlarm callCentre(s)
State diagram of a FAX machine
Idle ringing
Receiving
Process
member
Second
collaboration
First
collaboration
Realization of Use Case through collaboration
Third
collaboration
Realization of Use Case through collaboration
Fourth
collaboration
Realization of Use Case through collaboration
Final
collaboration
diagram
Collaboration Diagram : example
c: Client
Focus
Life
of control
line
s: Caller : Switch r: Caller
Lift Receiver
setDialTone()
{ dialing execution Time<30 sec}
*dialDigit(d) routeCall(s,n)
Dialing
Statement
A company consists of one or more departments as
well as one or more offices. One of the office is
designated to be the headquarter. Departments are
located at the offices. Moreover, a department may
further consist of zero or more departments.
Persons are attached to departments. Each
department has a manager, who of course, is a
person attached to the department. There should be
provisions to get the photo of a person, his/her
voice recording, contact information and other
personal records. An authorized user may obtain
information regarding a person from personal
record.
class Company
aggregation
Name
* 1…* 1…*
Department multiplicity Office
Employee 1 … * 1 Manager
Person
ContactInformation
Name: Name attributes
EmployeeID: Integer operations Address: String
Title: String Interface
getPhoto(p: photo)
getSandBite() PersonnelRecord
getContactInformation()
taxID
getPersonalRecords()
employmentHistory
salary
dependency I Secure Information
Object Diagram
Objects diagrams show a set of
objects and their relationships. They
represent static snapshots of
instances of the things found in class
diagrams.
d1 : Department d2 : Department
name = “Sales” name = “R&D”
link
d3 : Department
Object Attribute value
name = “US Sales”
Anonymous object
Manager : Communication
p : Person address = “1472 Miller St.”
name = “Erin”
employeeID = 4362
title = “VP of Sales”
Component Diagram
Interp.cpp Signal.cpp
------ ------
------ ------
------ ------
------ ------
Irq.h Device.cpp
------ ------
------ ------
------ ------
------ ------
Modelling an executable release:
Executable release of an autonomous robot
path.dll collision.dll
driver.dll
{ version = 8.1.2.3 }
IDrive
IselfTest
Component Diagram :
Modeling of Physical Database
School.db
School.db School.db
{ location = Server A } { location = Server B }
<<copy>>
Deployment
Diagram
<<processor>> <<processor>>
Caching Caching
Server Server
<<processor>>
<<processor>> <<processor>> <<processor>>
Printing
Server Server Server
Server
Deployment diagram :
Modeling a client / server
system
Server
: regional
server
: Internet
: country
server
: regional
server
: regional
server
: logging
Deployment diagram of a fully server
distributed system
Deployment Diagram :
example
Network
server
server
local
server
Database
client
Client
program
No specific rule,
but here is a
typical case.
A few rules-of-thumb