Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 36

Thursday, April 4, 2024

CHAPTER TWO

UNIFIED MODELING
LANGUAGE (UML)

1
Thursday, April 4, 2024
WHAT IS UML:

 UML → “Unified Modeling Language”

 Unified: UML has become a world standard


 a standard language for specifying, visualizing, constructing,
and documenting the artifacts of software systems.
 Modeling :Describing a software system at a high
level of abstraction

2
THE UNIFIED MODELING LANGUAGE
(UML):

Where it can be used: (UML) is a set


of notations and conventions used to
describe and model an application.
Building blocks of the UML
UML HAS THREE CATEGORIES:
Things, the objects
Relationships, the glue that holds things
together
Diagrams, categorized as either
structure or behavioral
THINGS INCLUDE:
 Structural things that define the conceptual and
physical structures of an O-O system and are
described by nouns
 Behavioral things, the verbs of a UML model
that represent the behavior of the system
and the states of the system before, during,
and after the behaviors occur
 Grouping Things that refers to related things
 An notational Things refer to the explanatory part
of the UML, Providing more information through
notes.
AMONG THE RELATIONSHIPS THAT EXIST BETWEEN
THE DIFFERENT THINGS INCLUDE:

 Dependencies :-where one thing affects another thing that


uses it
 Associations :- association describe structural connections
between things
 Generalizations:- which describe a relationship between a
general kind of thing and a more specific kind of thing, used
for modeling class inheritance and specialization
 Aggregations,:-which show how the whole object is composed
of the sum of its parts
UML DIAGRAMS INCLUDE

Thursday, April 4, 2024


 Class diagrams :-used to model the static structural
design of a system
 Use case diagrams:-showing the actors and the use
cases
 Sequence diagrams :-that depict a succession of
interactions between object instances over time and
they show the processing described in use case
scenarios
 Activity diagrams:- show the flow of activities within
a process
 Object diagrams :-portray the state of class instances
and their relationships at a point in time
7
-Component diagrams:- show an overview of

Thursday, April 4, 2024


the system architecture
-Deployment diagram:- illustrates the physical
implementation of the system, including the hardware
-Collaboration diagrams:- illustrate a sequence of
object interactions showing the organization of the
objects during the interactions
-State chart diagrams:- show the states of an object and
the events and conditions that trigger a transition from
8

one state to another


1. USE CASE DIAGRAM:
 Relationship between actors and use cases;
capturing user requirements.
 Actors: An actor is represents a user or another
system that will interact with the system that you
are modeling
 Use cases: an external view of the system that
represents some actions the user might perform in
order to complete a task

9
Thursday, April 4, 2024
USE CASE DIAGRAM - EXAMPLE:
sales company might follow these
steps :
Browse catalog and select items.
Call sales representative.
Supply shipping information.
Supply payment information.
Receive conformation number
from salesperson.
10
USE CASE DIAGRAM - EXAMPLE:

Thursday, April 4, 2024


 The salesperson
could also be
included in this use
case diagram
because the
salesperson is also
interacting with the
ordering system.

11
USE CASE DIAGRAM:

Thursday, April 4, 2024


 Relationships in Use Cases
 Include: a use case includes the functionality
described in another use case. (directed arrow
having a dotted shaft, labeled <<include>> )
<<include>>

12
USE CASE DIAGRAM:

Thursday, April 4, 2024


 Extend: the child use case, the parents use case.
<<extend>>

The "Perform Pathological Tests" use case is a


specialized version of the generic "Perform
medical tests" use case.

13
USE CASE DIAGRAM:
 Generalizations: The child use case in the
generalization relationship has the underlying
business process meaning, but is an enhancement
of the parent use case. (directed arrow with a
triangle arrow head )
you can replace any occurrence of the
"Store patient records (paper file)" use
case in the business flow of your system
with the "Store patient records
(computerized file)" use case without
impacting any business flow.

14
CLASS DIAGRAM:
 Class diagrams are widely used to describe the types
of objects in a system and their relationships

 Each class is represented by a rectangle subdivided


into three compartments

 Name
 Attributes
 Operations

15
Thursday, April 4, 2024
CLASS DIAGRAM:
 Modifiers are used to indicate visibility of attributes
and operations.
 ‘+’ is used to denote Public visibility (everyone)
 ‘#’ is used to denote Protected visibility (friends)
 ‘-’ is used to denote Private visibility (no one)
Account Name Name
- Customer_Name
- Balance
Attributes
+addFunds( ) Operations
+withDraw( )
+transfer( )

16
Thursday, April 4, 2024
CLASS DIAGRAM:
 There are two kinds of Relationships
 Generalization (parent-child relationship)
 Association (student enrolls in course)

 Associations can be further classified as


 Aggregation
 Composition

17
CLASS DIAGRAM:

Thursday, April 4, 2024


 Generalization

Example:
Supertype Customer

Regular Loyalty
Customer Customer

Subtype1 Subtype2

 -Inheritance is a required feature of object orientation


 -Generalization expresses a parent/child relationship
among related classes.
- Used for abstracting details in several layers
18
CLASS DIAGRAM:

Thursday, April 4, 2024


 Association
 Associations represent static relationships between
classes.
 (association names  filled arrow )
 (Place roles near the end of an association)

19
CLASS DIAGRAM:

Thursday, April 4, 2024


 Association : Composition and Aggregation
 Association: Models the part–whole relationship
 Composition : (filled diamond)
“Every part may belong to only one whole, and If the
whole is deleted, so are the parts”
 Aggregation : (hollow diamond).
“It is a specific kind of Container-Containee relationship”

20
CLASS DIAGRAM:

Thursday, April 4, 2024


 Aggregation Vs Composition
 Composition is really a strong form of association
 components have only one owner
 components cannot exist independent of their owner
 components live or die with their owner
 e.g. Each car has an engine that can not be shared
with other cars
 Aggregations
 may form "part of" the association, but may not be
essential to it. They may also exist independent of
the aggregate. e.g. Employees may exist
independent of the team.

21
INTERACTION DIAGRAMS:

Thursday, April 4, 2024


 Interaction diagrams are used when you want to model
the behavior of several objects in a use case

 UML supports two types of interaction diagrams


 Sequence diagrams
Sequence diagrams generally show the sequence of
events that occur

 Collaboration diagrams
Collaboration diagrams demonstrate how objects are
statically connected.

22
SEQUENCE DIAGRAM:

Thursday, April 4, 2024


 Object Interaction:

A B
Self-Call: A message that
Synchronous
an Object sends to itself.

Condition: indicates when Asynchronous

a message is sent. The Transmission


message is sent only if the delayed

condition is true.
[condition] remove()
Condition
*[for each] remove()
Iteration

Self-Call

23
SEQUENCE DIAGRAM:

Thursday, April 4, 2024


 For Making a Phone Call:

Caller Phone Recipient

Picks up

Dial tone

Dial

Ring notification Ring

Picks up

Hello

24
Thursday, April 4, 2024
COLLABORATION DIAGRAMS:
 Collaboration diagrams are equivalent to
sequence diagrams. All the features of
sequence diagrams are equally
applicable to collaboration diagrams
 Use a sequence diagram when the
transfer of information is the focus of
attention
 Use a collaboration diagram when
concentrating on the classes
25
Thursday, April 4, 2024
STATE DIAGRAM:
 Billing Example:
 State Diagrams show the sequences of states an
object goes through during its life cycle in response
to stimulin, together with its responses and actions;

Start End
Unpaid Paid
Invoice created payin Invoice destroying
g

26
Thursday, April 4, 2024
ACTIVITY DIAGRAM:
 Activity diagrams describe the workflow behavior of a
system.
 similar to state diagrams because activities are the
state of doing something

 Activity diagrams can show activities that are


conditional or parallel.

27
Thursday, April 4, 2024
28
ACTIVITY DIAGRAMS:
Object Diagrams

 Format is
 Instance name : Class name
 Attributes and Values

Example:
OBJECT DIAGRAMS
 Shows instances of Class Diagrams and links
among them
 An object diagram is a snapshot of the objects in a
At a point in time
system
With a selected focus

 Interactions – Sequence diagram


 Message passing – Collaboration diagram

 Operation – Deployment diagram


COMPONENT DIAGRAM:

Thursday, April 4, 2024


 Shows various components in a system and their
dependencies, interfaces
 Explains the structure of a system

 Usually a physical collection of classes


 Similar to a Package Diagram in that both are used
to group elements into logical structures
 With Component Diagrams all of the model elements
are private with a public interface whereas Package
diagrams only display public items.

31
COMPONENT DIAGRAM NOTATION:

Thursday, April 4, 2024


 Components are shown as rectangles with two tabs at
the upper left

 Dashed arrows indicate dependencies


 Circle and solid line indicates an interface to the
component

32
Deployment Diagrams:
 Shows the physical architecture of the hardware
and software of the deployed system

 Nodes
 Typically contain components or packages
 Usually some kind of computational unit; e.g.
machine or device (physical or logical)

 Physical relationships among software and


hardware in a delivered systems
 Explains how a system interacts with the
external environment
Deployment Diagrams:
SOME DEPLOYMENT EXAMPLES:
Deployment Diagrams:
DEPLOYMENT EXAMPLE:

Often the Component Diagram is combined with the


Deployment
CONCLUSION:
 UML is a standardized specification language for object

Thursday, April 4, 2024


modeling
 Several UML diagrams:
 Use-case diagram: a number of use cases (use case
models the interaction between actors and software)
 Class diagram: a model of classes showing the static
relationships among them including association and
generalization.
 Sequence diagram: shows the way objects interact with
one another as messages are passed between them.
Dynamic model
 State diagram: shows states, events that cause
transitions between states. Another dynamic model
reflecting the behavior of objects and how they react to
specific event
 Activity diagram: describes the state of activities by
showing the sequence of activities performed.

36

You might also like