UML
UML
Chakradhar
UML
• UML stands for Unified Modeling Language.
Visibility + Public
Use visibility markers to signify
who can access the information
- Private
ItsContext
DrawingContext
OPERATION() OPERATION()
1
inherit
contains
0...*
CLASS CLASS CLASS
Interface Lollypop
Shape WindowsDC
DrawingContext
Turnstile FSM designed with the State pattern.
Turnstile FSM implemented using the State pattern.
interface TurnstileState
{
protected static LockedState LOCKED;
protected static UnlockedState UNLOCKED;
+ATTRIBUTE 1
<< import >>
# ATTRIBUTE 2
…ATTRIBUTE 3 PACKAGE NAME
+ ATTRIBUTE 1
+ ATTRIBUTE 2
# ATTRIBUTE 1
# ATTRIBUTE 2
…ATTRIBUTE 3
UML
Object Diagrams
Object Name: CLASS
Object diagrams describe
Attribute Type = ‘Value’
the static structure of a
Attribute Type = ‘Value’
system at a particular
Attribute Type = ‘Value’
time. They can be used to
test class diagrams for
accuracy.
Multiple Objects :
You can illustrate multiple
Object name : Class
objects as one symbol if the
Multiple Objects
attributes of the individual
objects are not important.
Object Diagrams
Basic Object Diagram Symbols and Notations
Links :
Links are instances of associations.
You can draw a link using the lines
used in class diagrams.
Self Linked :
Objects that fulfill more than
Object name : Class
one role can be self-linked.
Self Linked
USE CASE
USE CASE
<<USES>>
System:
USE CASE
Draw your system
boundaries using a
USE CASE
rectangle that contains
use cases. ACTOR
the boundaries.
Use Case Diagrams
Use Case:
USE CASE Draw use cases using ovals. Label
with ovals with verbs that represent
the systems’ function
Actor:
Actors are the users of a system.
ACTOR
When one system is the actor of
<<ACTOR>> another system, label the actor
System A system with the actor stereotype.
Use Case Diagrams
Relationship:
USE CASE
Illustrate Relationship <<
US
ES
between an actor and a ACTOR
>>
use case with a simple USE CASE
>
line. For relationships DS>
E N
XT
among use cases, use < < E
“uses” or “extends”.
USES relationship indicates that one use case
is needed by another in order to perform a task.
EXTENDS relationship indicates alternative
options under a certain use case.
System Boundary Diagram
System Boundary Diagram
Use Case Diagrams
The one thing to remember about use cases is,
tomorrow they are going to change.
ACTOR
[condition]
Message Name
[condition] [condition]
Activation
boxes represent the time an
object needs to complete a
task.
Activations
Sequence Diagrams
Messages are arrows that
Object: Class Object: Class
ACTOR
represent communication
between objects.
Use half-arrowed lines to
represent asynchronous
messages.
Asynchronous messages
Messages are sent from an object that
will not wait for a response
Simple from the receiver before
continuing
Synchronous
Object: Class
ACTOR
Lifelines
Event / Action
State State
Event / Action
Do / Activity Do / Activity
State chart Diagrams
States represent situations during the
State life of an object. You can easily
Do / Activity illustrate a state in SmartDraw by using
a rectangle with rounded corners.
Activity
Activity
:Class
Activity
:Class
Activity Diagrams
Initial State A filled circle followed by an
arrow represents the initial action state.
Final State An arrow pointing to a filled
circle nested inside another circle
represents the final
Object Flow refers to the creation and
modification of objects by activities.
An object flow arrow from an action to Activity
an object means that the action creates
or influences the object. An object flow
arrow from an object to an action Object name : Class
indicates that the action state uses the
object.
Activity Diagrams
Action states represent the no interruptible
Activity actions of objects. You can draw an action
state in SmartDraw using a rectangle with
rounded corners.
Activity
Action Flow arrows illustrate the
relationships among action states.
Activity
Activity
Branching A diamond
represents a decision with
[condition]
alternate paths. The outgoing
Activity alternates should be labeled
[condition] with a condition or guard
Activity expression. You can also label
one of the paths “else”
Activity Diagrams
Activity Synchronization bar helps illustrate
parallel transitions. Synchronization
is also called forking and joining.
Activity Activity
Object : Class
Swim lanes group related
Activity
activities into one column.
Subway Turnstile
Turnstile with abnormal events.
Turstile with Violation state
Turnstile with Diagnostic Mode
UML
Component Diagrams
Component diagrams describe the organization of
physical software components, including source
code, run-time (binary) code, and executables.
Component
Component
Component
Component Diagrams
Component is a physical building block
Component
of the system. It is represented as a
Component
Dependencies Draw
Component Dependencies among
components using dashed
Dependency
arrows.
Component
UML
Deployment Diagrams depict the physical
resources in a system, in nodes, components and
connections.
Node Component
Name
Component
Node Component
Node Component
Name Name
Component Component
Deployment Diagrams
Node is a physical resource that Node Name
executes code components.