You are on page 1of 59

Unified Modeling Language (UML)

Shashank Mouli Satapathy

January 16, 2014

Department of Computer Science & Engineering


National Institute of Technology Rourkela
Rourkela- 769008, India

Shashank Mouli Satapathy

Unified Modeling Language (UML)

January 16, 2014

Introduction

Importance of Modeling
A model is a simplification of reality.
Why do we model?
We build model, so that we can better understand the system, we are
developing.
Through modeling, we can achieve four aims:
Models help us to visualize a system as it is or as we want it to be.
Models permit us to specify the structure or behavior of system.
Models give us a template that guides us in constructing a system.
Models document the decisions we have made.
Shashank Mouli Satapathy

Unified Modeling Language (UML)

January 16, 2014

Introduction

UML

UML
The Unified Modeling Language (UML) is a family of graphical notations, backed by single meta-model, that help in describing and
designing software systems, particularly software systems built using the object-oriented (OO) style .
The Unified Modeling Language (UML) is a graphical language for
creating diagrams that are useful in the software development process.
The UML provides a set of standard graphical symbols and the rules
for combining them.
The Unified Modeling Language has quickly become the de-facto
standard for building Object-Oriented software.
Shashank Mouli Satapathy

Unified Modeling Language (UML)

January 16, 2014

Introduction

OMG

OMG

The UML is a relatively open standard, controlled by the Object


Management Group (OMG), an open consortium of companies.
The OMG was formed to build standards that supported interoperability, specifically the interoperability of object-oriented systems.
The OMG is perhaps best known for the CORBA (Common Object
Request Broker Architecture) standards.
UML 1.0 specification draft was proposed to the OMG in January
1997.

Shashank Mouli Satapathy

Unified Modeling Language (UML)

January 16, 2014

Introduction

Definition

Definition

The OMG specification states :


The Unified Modeling Language (UML) is a graphical language for
visualizing, specifying, constructing , and documenting the artifacts of
a software-intensive system.

The UML offers a standard way to write a systems blueprints, including


conceptual things such as business processes and system functions as well
as concrete things such as programming language statements, database
schemas, and reusable software components.

Shashank Mouli Satapathy

Unified Modeling Language (UML)

January 16, 2014

Introduction

Definition

Definition(Contd..)
UML is a language for Visualizing : The UML is much more
than just a bunch of graphical symbols. Rather, behind each symbol
in UML notation, there is a well defined semantics available.
UML is a language for Specifying : Specifying means building models that are precise, unambiguous and complete. UML addresses the specification of all important analysis, design and implementation decisions that must be made in developing and deploying
a s/w system.
UML is a language for Constructing : UML is not visual
programming language, but its models can be directly connected to
a variety of programming language. This means that it is possible to
map from a model in UML to a programming language (like JAVA,
C++ etc).
Shashank Mouli Satapathy

Unified Modeling Language (UML)

January 16, 2014

Introduction

Definition

Definition(Contd..)
UML is a language for Documenting :
Requirements
Architecture
Design
Source code
Project Plans
Test
Prototype
Releases

Shashank Mouli Satapathy

Unified Modeling Language (UML)

January 16, 2014

Introduction

Application Areas

Application Areas of UML


Enterprise Information System
Banking and Financial Services
Telecommunications
Transportations
Defence or Aerospace
Retail
Medical Electronics
Scientific
Distributed Web-based Services etc..

Shashank Mouli Satapathy

Unified Modeling Language (UML)

January 16, 2014

Conceptual Model

Conceptual Model of UML

As UML describes the real time systems, it is very important to


make a conceptual model and then proceed gradually.
Conceptual model of UML can be mastered by learning the following
three major elements:
UML building blocks
Rules to connect the building blocks
Common mechanisms of UML

Shashank Mouli Satapathy

Unified Modeling Language (UML)

January 16, 2014

Conceptual Model

UML Building Blocks

UML Building Blocks

The building blocks of UML can be defined as :


Things
Relationships
Diagrams

Shashank Mouli Satapathy

Unified Modeling Language (UML)

January 16, 2014

10

Conceptual Model

UML Building Blocks

Things

Things are the most important building blocks of UML. Things can be:
Structural
Behavioral
Grouping
Annotational

Shashank Mouli Satapathy

Unified Modeling Language (UML)

January 16, 2014

11

Conceptual Model

Things

Structural Things
The Structural things define the static part of the model.
They represent physical and conceptual elements.
The various structural things are :
Class : It is a set of objects that share the same attributes, operations, relationship and semantics.

Interface : A collection of functions that specify a service of a class


or component, i.e. externally visible behavior of that class.

Shashank Mouli Satapathy

Unified Modeling Language (UML)

January 16, 2014

12

Conceptual Model

Things

Structural Things(Contd..)
Collaboration : A larger pattern of behaviors and actions. Example: All classes and behaviors that create the modeling of a moving
tank in a simulation.

Use case : A sequence of actions that a system performs that


yields an observable result. Used to structure behavior in a model.
Is realized by a collaboration.

Shashank Mouli Satapathy

Unified Modeling Language (UML)

January 16, 2014

13

Conceptual Model

Things

Structural Things(Contd..)
Active Class : Like a class but its represents behavior that runs
concurrent with other behaviors, i.e. threading.

Component : A physical and replaceable part of a system that


implements a number of interfaces. Example: a set of classes, interfaces, and collaborations.

Node : A physical element existing at run time and represents a


resource.

Shashank Mouli Satapathy

Unified Modeling Language (UML)

January 16, 2014

14

Conceptual Model

Things

Behavioural Things
A behavioral thing consists of the dynamic parts of UML models.
The two types of behavioral things are :
Interaction : A behavior made up of a set of messages exchanged
among a set of objects in a particular context to accomplish a specific purpose.

State Machine : A behavior that specifies the sequences of states


an object or interaction goes through during its lifetime in response
to events.

Shashank Mouli Satapathy

Unified Modeling Language (UML)

January 16, 2014

15

Conceptual Model

Things

Grouping Things

Grouping things can be defined as a mechanism to group elements


of a UML model together.
There is only one grouping thing available :
Package : A general purpose mechanism for organizing elements
into groups.

Shashank Mouli Satapathy

Unified Modeling Language (UML)

January 16, 2014

16

Conceptual Model

Things

Annotational Things

Annotational things can be defined as a mechanism to capture remarks, descriptions, and comments of UML model elements.
There is only one annotational thing available :
Note : It is used to render comments, constraints etc of an UML
element.

Shashank Mouli Satapathy

Unified Modeling Language (UML)

January 16, 2014

17

Conceptual Model

Relationship

Relationship
It is another most important building block of UML. It shows how
elements are associated with each other and this association describes the functionality of an application.
There are four kinds of relationships available :
Dependency : A semantic relationship in which a change on one
thing (the independent thing) may cause changes in the other thing
(the dependent thing).

Shashank Mouli Satapathy

Unified Modeling Language (UML)

January 16, 2014

18

Conceptual Model

Relationship

Relationship(Contd..)

Association : A structural relationship describing links between


objects. May also include labels to indicate number and role of the
links. In the example there may be any number of employees (*)
each of which has 0 or 1 employer. The double arrowhead is used
to indicate a has-a relationship, meaning there is 1 employer who
may have many (*) employees.

Shashank Mouli Satapathy

Unified Modeling Language (UML)

January 16, 2014

19

Conceptual Model

Relationship

Relationship(Contd..)
Generalization : Simply put this describes the relationship of a
parent class (generalization) to its subclasses (specializations).

Realization : Defines a relationship in which one class specifies


something that another class will perform. Example: The relationship between an interface and the class that realizes or executes that
interface.

Shashank Mouli Satapathy

Unified Modeling Language (UML)

January 16, 2014

20

Conceptual Model

Diagrams

Diagrams

UML diagrams are the ultimate output of the entire discussion.


All the elements, relationships are used to make a complete UML
diagram and the diagram represents a system.
The visual effect of the UML diagram is the most important part
of the entire process.
All the other elements are used to make it a complete one.

Shashank Mouli Satapathy

Unified Modeling Language (UML)

January 16, 2014

21

Conceptual Model

Diagrams

UML Diagrams(Contd..)
UML 1.x includes the following NINE diagrams :
1

Use Case Diagram

Activity Diagram

Class Diagram

Statechart Diagram

Sequence Diagram

Collaboration Diagram

Component Diagram

Deployment Diagram

Object Diagram

Shashank Mouli Satapathy

Unified Modeling Language (UML)

January 16, 2014

22

Conceptual Model

Diagrams

UML 2.x

UML has matured significantly since UML 1.1. Several minor revisions (UML 1.3, 1.4, and 1.5) fixed shortcomings and bugs with the
first version of UML, followed by the UML 2.0 major revision that
was adopted by the OMG in 2005.
UML versions 2.1.1 and 2.1.2 appeared in 2007, followed by UML
2.2 in February 2009. UML 2.3 was formally released in May 2010.
UML 2.4.1 was formally released in August 2011. UML 2.5 was
released in October 2012 as an In process version and has yet to
become formally released.

Shashank Mouli Satapathy

Unified Modeling Language (UML)

January 16, 2014

23

Conceptual Model

Diagrams

UML 2.x (Contd..)

UML 2.2 has 14 types of diagrams divided into two categories.


Seven diagram types represent structural information, and the other
seven represent general types of behavior, including four that represent different aspects of interactions.

Shashank Mouli Satapathy

Unified Modeling Language (UML)

January 16, 2014

24

Conceptual Model

Diagrams

UML 2.x (Contd..)


These diagrams can be categorized hierarchically as shown in the
following diagram:

Shashank Mouli Satapathy

Unified Modeling Language (UML)

January 16, 2014

25

4+1 Architectural View Model

4 + 1 Architectural View Model of UML


Philippe Kruchten originally presented the 4+1 View Model to describe the architecture of software-intensive systems.
This approach uses multiple views to separate stakeholders concerns.
The 4+1 View Approach is widely accepted by the software industry
to represent application architecture blueprints.
Architecture also means different things to different stakeholders.
For example, a Network Engineer would only be interested in the
hardware and network configuration of the system; a Project Manager in the key components to be developed and their timelines; a
Developer in classes that make up a component; and a Tester in
scenarios.
Shashank Mouli Satapathy

Unified Modeling Language (UML)

January 16, 2014

26

4+1 Architectural View Model

4 + 1 Architectural View Model of UML


(Contd..)

So, we need multiple view points for distinct stakeholders needs,


showing what is relevant while masking the details that are irrelevant.
The 4+1 View Approach is an architecture style to organize an applications architecture representations into views to meet individual
stakeholders needs.

Shashank Mouli Satapathy

Unified Modeling Language (UML)

January 16, 2014

27

4+1 Architectural View Model

4 + 1 Architectural View Model of UML


(Contd..)

Shashank Mouli Satapathy

Unified Modeling Language (UML)

January 16, 2014

28

4+1 Architectural View Model

4 + 1 Architectural View Model of UML


(Contd..)

Shashank Mouli Satapathy

Unified Modeling Language (UML)

January 16, 2014

29

Tool Support

UML Tools
StarUML - StarUML is an open source project to develop fast,
flexible, extensible, featureful, and freely-available UML/MDA platform running on Win32 platform.
ArgoUML - ArgoUML is the leading open source UML modeling
tool and includes support for all standard UML diagrams.
MagicDraw UML - It is a visual UML, SysML, BPMN, and
UPDM modeling tool with team collaboration support. Designed
for business analysts, software analysts, programmers, and QA engineers.
GenMyModel - An online UML modeling tool
UML Tools List @ Wiki - Comprehensive list of UML Tools
and Utilities.
Shashank Mouli Satapathy

Unified Modeling Language (UML)

January 16, 2014

30

Tool Support

UML Tools (Contd..)


IBM Rational Software Architect - IBM RSA builts on Eclipse
version 3.4 and supports UML version 2.1. IBM Rational Software
Architect, (RSA) made by IBMs Rational Software division, is a
modeling and development environment that uses the Unified Modeling Language (UML) for designing architecture for C++ and Java
2 Enterprise Edition (J2EE) applications and web services.
IBM Rational Rose - With the IBM Rational June 2006 Product Release, IBM withdrew the eXtended Development Environment(XDE) family of products and introduced the Rational Rose
Family of products as replacements. The Rational Rose Family of
products is a set of UML modeling tools for software design. It simplifies the complex process of software design, creating a blueprint
for construction of software systems.
Shashank Mouli Satapathy

Unified Modeling Language (UML)

January 16, 2014

31

Useful Resources

Useful Resources

Object Management Group - OMG Unified Modeling Language


Specification.
UML @ Wiki - Good tutorial on UML.
UML r Resource Page - A listing of various other resources for
UML.

Shashank Mouli Satapathy

Unified Modeling Language (UML)

January 16, 2014

32

Standards

Standards
Two types of standards:
De-Jure
De-facto
De-jure standards, or standards according to law , are endorsed by a formal standards organization. The organization ratifies
each standard through its official procedures and gives the standard
its stamp of approval.
De-facto standards, or standards in actuality , are adopted
widely by an industry and its customers. They are also known as
market-driven standards. These standards arise when a critical mass simply likes them well enough to collectively use them.
Market-driven standards can become de jure standards if they are
approved through a formal standards organization.
Shashank Mouli Satapathy

Unified Modeling Language (UML)

January 16, 2014

33

SRS

SOFTWARE REQUIREMENT
SPECIFICATION

Shashank Mouli Satapathy

Unified Modeling Language (UML)

January 16, 2014

34

SRS

Sample SRS

Sample SRS
R 1: Withdraw cash
Description: The withdraw cash function first determines the type of
account that the user has and the account number from which the user
wishes to withdraw cash. It checks the balance to determine whether
the requested amount is available in the account. If enough balance is
available, it outputs the required cash, otherwise it generates an error
message.
R 1.1: Select withdraw amount option
Input: Withdraw amount option
output: User prompted to enter the account type
R 1.2: Select account type
Input: User option from any one of the following: savings / current.
Output: Prompt to enter amount
Shashank Mouli Satapathy

Unified Modeling Language (UML)

January 16, 2014

35

SRS

Sample SRS

Sample SRS (Contd..)

R 1.3: Get required amount


Input: Amount to be withdrawn in integer values greater than 100 and
less than 10,000 in multiples of 100.
Output: The requested cash and printed transaction statement.
Processing: The amount is debited from the users account, if sufficient
balance is available, otherwise an error message is displayed.

Shashank Mouli Satapathy

Unified Modeling Language (UML)

January 16, 2014

36

UML Diagrams

UML DIAGRAMS

Shashank Mouli Satapathy

Unified Modeling Language (UML)

January 16, 2014

37

UML Diagrams

Use Case Diagram

Use Case Diagram

A use case diagram can portray the different types of users of a


system and the various ways that they interact with the system.
The purpose of use case diagram is to capture the dynamic aspect
of a system.
Use case diagrams are used to gather the requirements of a system
including internal and external influences.
These requirements are mostly design requirements.
So when a system is analyzed to gather its functionalities use cases
are prepared and actors are identified.

Shashank Mouli Satapathy

Unified Modeling Language (UML)

January 16, 2014

38

UML Diagrams

Use Case Diagram

Use Case Diagram (Contd..)

Shashank Mouli Satapathy

Unified Modeling Language (UML)

January 16, 2014

39

UML Diagrams

Use Case Diagram

Use Case Diagram (Contd..)

Actor :
An actor is an idealization of an external person, process, or thing
interacting with a system, subsystem, or class.
An actor characterizes the interactions that outside users may have
with the system.
Each actor interacts with one or more use cases by exchanging messages.

Shashank Mouli Satapathy

Unified Modeling Language (UML)

January 16, 2014

40

UML Diagrams

Use Case Diagram

Use Case Diagram (Contd..)


Use Case :
A use case is a coherent unit of externally visible functionality provided by a system unit and expressed by sequences of messages
exchanged by the system unit and one or more actors of the system
unit.
The purpose of a use case is to define a piece of coherent behavior
without revealing the internal structure of the system.
The dynamics of a use case may be specified by UML interactions,
shown as statechart diagrams, sequence diagrams, collaboration diagrams, or informal text descriptions.
When use cases are implemented, they are realized by collaborations
among classes in the system.
Shashank Mouli Satapathy

Unified Modeling Language (UML)

January 16, 2014

41

UML Diagrams

Use Case Diagram

Use Case Diagram (Contd..)


Kinds of Use Case Relationships :

Shashank Mouli Satapathy

Unified Modeling Language (UML)

January 16, 2014

42

UML Diagrams

Use Case Diagram

Use Case Diagram (Contd..)

Shashank Mouli Satapathy

Unified Modeling Language (UML)

January 16, 2014

43

UML Diagrams

Activity Diagram

Activity Diagram

Activity diagrams are graphical representations of workflows of stepwise activities and actions with support for choice, iteration and
concurrency.
It also captures the dynamic behaviour of the system.
Activity diagrams deals with all type of flow control by using different elements like fork, join etc.

Shashank Mouli Satapathy

Unified Modeling Language (UML)

January 16, 2014

44

UML Diagrams

Activity Diagram

Activity Diagram (Contd..)

Shashank Mouli Satapathy

Unified Modeling Language (UML)

January 16, 2014

45

UML Diagrams

Activity Diagram

Activity Diagram (Contd..)

An activity state is shown as a box with rounded ends containing a


description of the activity.
Simple completion transitions are shown as arrows.
Branches are shown as guard conditions on transitions or as diamonds with multiple labeled exit arrows.
A fork or join of control is shown the same way as on a statechart,
by multiple arrows entering or leaving a heavy synchronization bar.

Shashank Mouli Satapathy

Unified Modeling Language (UML)

January 16, 2014

46

UML Diagrams

Activity Diagram

Activity Diagram (Contd..)

Swimlanes :
It is often useful to organize the activities in a model according to
responsibility.
For example, by grouping together all the activities handled by one
business organization.
This kind of assignment can be shown by organizing the activities
into distinct regions separated by lines in the diagram.
Because of their appearance, each region is called a swimlane.

Shashank Mouli Satapathy

Unified Modeling Language (UML)

January 16, 2014

47

UML Diagrams

Activity Diagram

Activity Diagram (Contd..)


Object Flows :
An activity diagram can show the flow of object values, as well as
the flow of control.
An object flow state represents an object that is the input or output
of an activity.
For an output value, a dashed arrow is drawn from an activity to
an object flow state.
For an input value, a dashed arrow is drawn from an object flow
state to an activity.
If an activity has more than one output value or successor control
flow, the arrows are drawn from a fork symbol.
Similarly, multiple inputs are drawn to a join symbol.
Shashank Mouli Satapathy

Unified Modeling Language (UML)

January 16, 2014

48

UML Diagrams

Activity Diagram

Activity Diagram (Contd..)

Shashank Mouli Satapathy

Unified Modeling Language (UML)

January 16, 2014

49

UML Diagrams

Class Diagram

Class Diagram
A class is the description of a concept from the application domain
or the application solution.
The static view is displayed in class diagrams, so called because
their main focus is the description of classes.
Classes are drawn as rectangles. Lists of attributes and operations
are shown in separate compartments. The compartments can be
suppressed when full detail is not needed.
Relationships among classes are drawn as paths connecting class
rectangles.
A class diagram from the box office application is provided in the
next slide.

Shashank Mouli Satapathy

Unified Modeling Language (UML)

January 16, 2014

50

UML Diagrams

Class Diagram

Class Diagram (Contd..)

Shashank Mouli Satapathy

Unified Modeling Language (UML)

January 16, 2014

51

UML Diagrams

Class Diagram

Statechart Diagram

A state machine models the possible life histories of an object of a


class. A state machine contains states connected by transitions.
Each state models a period of time during the life of an object during
which it satisfies certain conditions.
When an event occurs, it may cause the firing of a transition that
takes the object to a new state.
When a transition fires, an action attached to the transition may
be executed.
State machines are shown as statechart diagrams.

Shashank Mouli Satapathy

Unified Modeling Language (UML)

January 16, 2014

52

UML Diagrams

Class Diagram

Statechart Diagram (Contd..)

Shashank Mouli Satapathy

Unified Modeling Language (UML)

January 16, 2014

53

UML Diagrams

Sequence Diagram

Sequence Diagram

A sequence diagram shows a set of messages arranged in time sequence.


Each classifier role is shown as a lifeline, i.e., a vertical line that
represents the role over time through the entire interaction.
Messages are shown as arrows between lifelines.
One use of a sequence diagram is to show the behavior sequence of
a use case.
When the behavior is implemented, each message on a sequence
diagram corresponds to an operation on a class or an event trigger
on a transition in a state machine.

Shashank Mouli Satapathy

Unified Modeling Language (UML)

January 16, 2014

54

UML Diagrams

Sequence Diagram

Sequence Diagram (Contd..)

Shashank Mouli Satapathy

Unified Modeling Language (UML)

January 16, 2014

55

UML Diagrams

Collaboration Diagram

Collaboration Diagram
A collaboration diagram shows the roles in the interaction as a
geometric arrangement.
The messages are shown as arrows attached to the relationship lines
connecting classifier roles.
The sequence of messages is indicated by sequence numbers prepended
to message descriptions.
One use of a collaboration diagram is to show the implementation
of an operation.
The collaboration shows the parameters and local variables of the
operation, as well as more permanent associations.
When the behavior is implemented, the message sequencing corresponds to the nested calling structure and signal passing of the
program.
Shashank Mouli Satapathy

Unified Modeling Language (UML)

January 16, 2014

56

UML Diagrams

Collaboration Diagram

Collaboration Diagram (Contd..)

Shashank Mouli Satapathy

Unified Modeling Language (UML)

January 16, 2014

57

UML Diagrams

Component Diagram

Component Diagram
A component is a physical unit of implementation with well-defined
interfaces that is intended to be used as a replaceable part of a
system.
Each component embodies the implementation of certain classes
from the system design.
Well-designed components do not depend directly on other components but on interfaces that components support. In that case, a
component in a system can be replaced by another component that
supports the proper interfaces.
A component is drawn as a rectangle with two small rectangles on
its side. It may be attached by solid lines to circles that represent
its interfaces.
A component diagram shows dependencies among components.
Shashank Mouli Satapathy

Unified Modeling Language (UML)

January 16, 2014

58

UML Diagrams

Component Diagram

Component Diagram (Contd..)

Shashank Mouli Satapathy

Unified Modeling Language (UML)

January 16, 2014

59

You might also like