UML Concepts & Diagrams
UML Concepts & Diagrams
Overview
• What is UML?
• A brief history of UML and its origins.
• Understanding the basics of UML.
• UML diagrams
• UML Modeling tools
What is
UML?
UML: Unified Modeling Language
• An industry-standard graphical
language for specifying, visualizing,
constructing, and documenting the
artifacts of software systems, as well
as for business modeling.
Tim
Year Version
e 2003: UML 2.0
2001: UML 1.4
1999: UML 1.3
1997: UML 1.0, 1.1
1996: UML 0.9 & 0.91
1995: Unified Method 0.8
Booch OMT -
Other ‘93 2
methods
Booch ‘91
OMT -
1
Types of UML Diagrams
Sequence Diagram:
Displays the time sequence of the objects participating in the
interaction.
Types of UML Diagrams
(Cont.)
Collaboration Diagram
Displays an interaction organized around the objects
and their links to one another.
State Diagram
Displays the sequences of states that an object of an
interaction goes through during its life in response to
received stimuli, together with its responses and
actions.
Component Diagram
Illustrate the organizations and dependencies of
the physical components in a system. A higher level
than class diagrams.
Use Case Diagrams
Borro
w
Employe
Clien e
t
Order Title
Fine Remittance
Superviso
r
employee
waitress
Use Case Diagram(core relationship)
A
orUse Case
in MS may be included by one or more Use
Visio
Cases, so it reduces duplication of functionality.
Example: the <list orders> Use Case may be
included
every time when the <modify order> Use Case is
run.
Use Case Diagram (core
relationship)
(TogetherSoft, Inc)
Use Case Diagrams(cont.)
• Pay Bill is a parent use case and Bill
Insurance is the child use case. (generalization)
Name
Account_Name
- Custom_Name
Attributes
- Balance
+AddFunds( ) Operations
+WithDraw( )
+Transfer( )
C++ Class Example
class Checking {
private:
char Customer_name[20];
float Balance;
public:
AddFunds(float);
WithDraw(float);
Transfer(float);
set_name(string);
get_name();
set_balance(float);
get_balance();
};
Notation of Class Diagram: association
Associations represent relationships between
instances
of classes .
An association is a link connecting two classes.
• Bi-directional association
Associations are assumed to be bi-directional
e.g. Flight and plane
notation:
• Uni-directional association
e.g. Order and item
notation:
Association: Multiplicity and Roles
student
1 *
Universit Perso
y n
0.. *
1
employe teache
r r
Multiplicity
Symbol Meaning Role
Rol
1 One and only one e groups many
“A given university
0..1 Zero or one people; some act as students,
M..N From M to N (natural language) others as teachers. A given student
* From zero to any positive integer
belongs to a single university; a
given teacher may or may not be
0..* From zero to any positive integer working for the university at a
1..* From one to any positive integer particular time.”
Notation of Class Diagram:
Generalization
Supertype Customer
Example:
Regular Loyalty
Customer Customer
Subtype
Subtype
2
1 or: Customer
Generalization
expresses a relationship
among related classes.
It is a class that includes
Regular Loyalty
its subclasses. Customer Customer
Notation of Class Diagram: Composition
COMPOSITIO Composition: expresses a relationship among
N Whole instances
Class of related classes. It is a specific kind of Whole-Part
Class W
relationship.
A B
• Activation bar
The long, thin boxes on the lifelines
are method-invocation boxes
indicting that indicate processing is
being performed by the target
object/class to fulfill a message.
Activation
bar X
• Rectangle also denotes when object Retur
is deactivated. n Deletio
n
Lifelin
• Deletion e
– Placing an ‘X’ on lifeline
– Object’s life ends at that point
Sequence Diagram
Message
6: remove
reservation
3 : [not available] reserve
title
User Reservation
s
5: title
6 : borrow
available
title 1: look
2: title up
data
4 : title
returned
Catalo
g
5 : hold
title
State Diagrams
(Billing Example)
Transition e Re
d
Yellow
Green
Event
Component Diagram
• Illustrate the organizations and dependencies of
the physical components in a system.
• Has a higher level of abstraction than a Class
diagram - usually implemented by one or more
classes.
Symbols and Notations
Components
a large rectangle with two smaller rectangles on the side.
Component Diagram (cont.)
Interface
An interface describes a group of operations
used or created by components. It represents a
declaration of a set of coherent public features
and obligations, similar to a contract.
Dependencies
dashed arrows.
Component Diagram (cont.)
order
custo
mer
accou
nt
(Radu
Marinescu[5])
A cleaner design
(Radu
Marinescu[5])
Reference
5. http://labs.cs.utt.ro/labs/acs/html/lectures/4/lecture4.pdf