You are on page 1of 46

Unified Modeling Language (UML)

UML stands for Unified Modeling Language used in the software


engineering filed to provide a standard way to visualize the design
of the system..
In 1997 UML was adopted as the standard modeling language
byObject Management Group (OMG)
It is visual modeling language used to specify, visualize, and
document the artifacts of an object oriented system under
development..
The UML consists of a number of graphical elements that combine
to form diagrams.

BCS

System Analysis and Design By: N.Josender

Diagram is the graphical presentation of set of elements


and their interactions.
Though well-known and widely used in education and
academic papers, as of 2013 UML is little-used in industry,
and most such use is informal and ad hoc
UML has been evolving since the second half of the 1990s
UML 2.5 was released in October 2012

BCS

System Analysis and Design By: N.Josender

Types of UML Diagrams


UML defines nine types of diagrams:
1.
2.
3.
4.
5.
6.
7.
8.
9.

BCS

Class diagram (SD)


Object diagram (SD)
Use case diagram (BD)
Sequence diagram (BD) / (ID)
Collaboration diagram (BD) / (ID)
State chart diagram (BD)
Activity diagram (BD)
Component diagram (SD)
Deployment diagram (SD)

System Analysis and Design By: N.Josender

Three Types of UML Diagrams


1) Structural diagram
Structure diagrams emphasize the things that must be present in the
system being modeled.
Since structure diagrams represent the structure, they are used
extensively in documenting the software architecture of software
systems..
2) Behavioral diagram
Behavior diagrams emphasize what must happen in the system being
modeled. Since behavior diagrams illustrate the behavior of a system,
they are used extensively to describe the functionality of software
systems.
3) Interaction diagram
Interaction diagrams, a subset of behavior diagrams, emphasize the flow
of control and data among the things in the system being modeled.
BCS

System Analysis and Design By: N.Josender

BCS

System Analysis and Design By: N.Josender

1 - Use Case Diagram


The purpose of use case diagram is to capture the dynamic
aspect of a system.
Use case diagrams are used to gather the functional
requirements of a system including internal and external
influences.
Use case Diagram Consists of following symbols:
1)Use case
2)Actor
3)Relationships

BCS

System Analysis and Design By: N.Josender

Draw a use case diagram for the following scenario.


An order clerk can place an order. When place the order
product should be ordered. When order is placed catalog of
the product can be checked.
When order is placed payment should be arranged. Payments
can be made by cash or credit card.
Answer is in next slide..

BCS

System Analysis and Design By: N.Josender

BCS

System Analysis and Design By: N.Josender

Actor
User, External devices, External systems can will be
represented as Actor.
Actor interact with system by send / receive messages from/to
system

BCS

System Analysis and Design By: N.Josender

Use case
Each use case represents what the system does (system
functionality)
Represented using an ovals.

Place Order

BCS

System Analysis and Design By: N.Josender

10

Associations
A relationship between an actor and a use case in which an
interaction occurs between them.
Modeled as a solid line connecting the actor and the use case
Maybe bidirectional or unidirectional

BCS

System Analysis and Design By: N.Josender

11

Use Case Relationship Types


Relationship between the use case can be one of three types
1) Include
The base use case explicitly incorporates the behavior of
another use case.

2)Extends
Shows optional behavior of a use case.

3)Generalization
Child use cases inherits.
BCS

System Analysis and Design By: N.Josender

12

BCS

System Analysis and Design By: N.Josender

13

BCS

System Analysis and Design By: N.Josender

14

BCS

System Analysis and Design By: N.Josender

15

2 - Class Diagrams
The purpose of the class diagram is to model the static view of
an application.
The class diagram is a static diagram. It represents the static
view of an application. It is also known as a structural
diagram.
The class diagram describes the attributes and operations of a
class.
The class diagrams are the only diagrams which can be
directly mapped with object oriented languages and thus
widely used at the time of construction.

BCS

System Analysis and Design By: N.Josender

16

A class
Represents a kind of person, place, or thing about which the system must
capture and store information.
An attribute
Represents properties that describe the state of an object.
A method
Represents the actions or functions that a class can perform.
An association
Represents a relationship between multiple classes, or a class and itself.

Cardinality/Multiplicity
Its refers to one object can communicate with how many objects of
another class
BCS

System Analysis and Design By: N.Josender

17

Class Notation
Class notation will have 3 parts.
1)Class name

2)Attributes of the class

3)Methods of the class

BCS

System Analysis and Design By: N.Josender

18

Relationship types between the classes

Relationship between the classes can be


1)Association
Teacher class)

(ex: relationship between student class &

2)Generalization (ex: Employee and Fulltime Employee, Par


time employee)
3)Aggregation (ex: Book class and Page class)

BCS

System Analysis and Design By: N.Josender

19

Multiplicity / Cardinality Types


Multiplicity/Cardinality can be

BCS

One

1..*

One or many

Many

1.. N

One or N objects

System Analysis and Design By: N.Josender

20

BCS

System Analysis and Design By: N.Josender

21

Draw class diagram for the following scenario.


One customer can make zero or many order. One order can
have zero or many payments. Payment can be
credit,cash,chek. Order contain one or more
Order detail. One order detail is associated with one item
Answer on the next page

BCS

System Analysis and Design By: N.Josender

22

BCS

System Analysis and Design By: N.Josender

23

Object Diagram
Object diagrams are derived from class diagrams so object
diagrams are dependent upon class diagrams.
Object diagrams represent an instance of a class diagram.
The basic concepts are similar for class diagrams and
object diagrams.
Object diagrams also represent the static view of a system
but this static view is a snapshot of the system at a
particular moment.
Object diagrams are used to render a set of objects and
their relationships as an instance.

BCS

System Analysis and Design By: N.Josender

24

BCS

System Analysis and Design By: N.Josender

25

BCS

System Analysis and Design By: N.Josender

26

Component Diagrams
It does not describe the functionality of the system but it
describes the components used to make those
functionalities.
component diagrams are used to visualize the physical
components (libraries, packages, files etc. ) in a system &
relationships among these components.
Component diagrams can also be described as a static
implementation view of a system.
A single component diagram cannot represent the entire
system but a collection of diagrams are used to represent
the whole.

Deployment Diagrams
Deployment diagrams are used for describing the hardware
components where software components are deployed.
Component diagrams and deployment diagrams are closely
related.
Component diagrams are used to describe the components
and deployment diagrams shows how they are deployed in
hardware.
But these two diagrams are special diagrams used to focus on
software components and hardware components.
Deployment diagram includes Nodes and the Relationship
among Nodes

Sequence Diagrams
The purposes of diagrams are to visualize the interactive
behavior of the system and to capture the different aspects of
the interaction.
The sequence diagram captures the time sequence of
message flow from one object to another .
So the following things are to identified clearly before drawing
the interaction diagram:
Objects taking part in the interaction.
Message flows among the objects.
The sequence in which the messages are flowing.
Object organization.

Diagram 1
1. The medical receptionist triggers the View Info method in an
instance P of the PatientInfo object class, supplying the patients
identifier, PID. P is a user interface object, which is displayed as a
form showing patient information.
2. The instance P calls the database to return the information
required, supplying the receptionists identifier to allow security
checking (at this stage, we do not care where this UID comes from).
3. The database checks with an authorization system that the user
is authorized for this action.
4. If authorized, the patient information is returned and a form on
the users screen is filled in. If authorization fails, then an error
message is returned.

Diagram 2
1. The receptionist logs on to the PRS.
2. There are two options available. These allow the direct transfer of
updated
patient information to the PRS and the transfer of summary health data
from the MHC-PMS to the PRS.
3. In each case, the receptionists permissions are checked using the
authorization system.
4. Personal information may be transferred directly from the user
interface object to the PRS. Alternatively, a summary record may be
created from the database and that record is then transferred.
5. On completion of the transfer, the PRS issues a status message and
the user
logs off.

PMS:DataB
ase

Collaboration Diagram
It shows the object organization as shown below. In
collaboration diagram the method call sequence is
indicated by some numbering.
The number indicates how the methods are called one
after another.
The method calls are similar to that of a sequence diagram.
But the difference is that the sequence diagram does not
describe the object organization where as the collaboration
diagram shows the object organization.
If the time sequence is important then sequence diagram is
used and if organization is required then collaboration
diagram is used.

Activity Diagram

Activity diagrams are intended to show the activities that


make up a system process and the flow of control from one
activity to another.
The start of a process is indicated by a filled circle; the end by
a filled circle inside another circle.
Rectangles with round corners represent activities, that is, the
specific sub-processes that must be carried out.

You may include objects in activity charts.


Arrows represent the flow of work from one activity to another.
A solid bar is used to indicate activity coordination. When the flow
from
more than one activity leads to a solid bar then all of these
activities must be complete before progress is possible.
When the flow from a solid bar leads to a number of activities,
these may be executed in parallel.
Arrows may be annotated with guards that indicate the condition
when that flow is taken.

State chart Diagrams


Statechart diagram used to model dynamic nature of a system.
They define different states of an object during its lifetime. And these
states are changed by events.
So Statechart diagrams are useful to model reactive systems.
Reactive systems can be defined as a system that responds to external
or internal events.
It describes the flow of control from one state to another state.
States are defined as a condition in which an object exists and it changes
when some event is triggered.
Important purpose is to model life time of an object from creation to
termination.

In UML state diagrams, rounded rectangles represent system


states.
They may include a brief description (following do) of the
actions taken in that state.
The labeled arrows represent stimuli that force a transition
from one state to another.
Can indicate start and end states using filled circles, as in
activity diagrams.

Example 2 State Diagram


control software for a very simple microwave oven to illustrate
event-driven modeling.
This simple microwave has a switch to select full or half power, a
numeric keypad to input the cooking time, a start/stop button, and
an alphanumeric display.
I have assumed that the sequence of actions in using the
microwave is:
1. Select the power level (either half power or full power).
2. Input the cooking time using a numeric keypad.
3. Press Start and the food is cooked for the given time.
For safety reasons, the oven should not operate when the door is
open and, on completion of cooking, a buzzer is sounded.

You might also like