Lesson DFD
Lesson DFD
DDiiaaggrraammss
((DDFFDD))
&& CCoonntteexxtt
ddiiaaggrraammss
OBJECTIVES
By the end of this lesson, students will be able to:
Understand the purpose and importance of DFDs
and Process Flow diagrams.
Identify the components of both diagrams.
Differentiate between different levels of DFDs.
Construct a simple DFD and Process Flow diagram.
INTRODUCTION
A Data Flow Diagram (DFD) and Process Flow
Diagram are graphical representations used to
visualize the movement of data and processes within a
system. DFDs focus on how data flows between
different components, while Process Flow diagrams
illustrate the sequence of steps in a process.
Data Flow Diagrams
⚫ A graphical tool, useful for
communicating with users, managers,
and other personnel.
⚫ Used to perform structured analysis to
determine logical requirements.
⚫ Useful for analyzing existing as well as
proposed systems.
⚫ Focus on the movement of data between
external entities and processes, and
between processes and data stores.
⚫ A relatively simple technique to learn and
Why DFD ?
⚫ Provides an overview of-
⚫ What data a system processes
⚫ What transformations are performed
⚫ What data are stored
⚫ What results are produced and where they
flow
⚫ Graphical nature makes it a good
communication tool between-
⚫ User and analyst
⚫ Analyst and System designer
DFD elements
⚫ Source/Sinks (External
entity)
⚫ Processes
⚫ Data Stores
⚫ Data flows
Symbols Used:
Gane & DeMarco &
Symbol
Sarson Yourdan
Symbol Symbol
External Entity
Process
Data store
Data flow
5
Descriptions :
🞇External Entity - people or organisations
that send data
into the system or receive data from the system.
🞇External Entity
Noun
3.
Hours 0
Worked Gross Pay
Calculate
Pay
d Gross
Rate Pay
Processes
⚫ Can connect to any other symbol (including
another process symbol)
⚫ Contain the business logic, also called
business rules
⚫ Referred to as a black box
1. 2. Inventor
Order 0 Accepted 0 y
Order Change
Verif Assembl
y e
Orde Order
r
Data Stores
Data store
⚫ Data in motion
⚫ Marks movement of data through the
system
- a pipeline to carry data.
⚫ Connects the processes, external
entities and data stores.
Data Flow
⚫ Generally unidirectional, If same data
flows in both directions, double-
headed arrow can be used.
⚫ Can represent flow between process
and data store by two separate
arrows
2.
Payment
1
Detail
D Accounts
Invoice Receivabl
Post 1
Detail
Paymen e
t
Decomposition Of DFD
1
Layers of DFD Abstraction for Course Registration System
1
8
A Context Diagram (Level 0)
⚫ The major information flows between the
entities and the system.
1
Rules for Level 1 Diagram :
🞇 Level 1 DFD, must balance with the context
diagram it describes.
2
Rules for Level 2 Diagram :
🞇Level 2 DFD must balance with the Level 1 it
describes.
2
Numbering
🞇 On level 1 processes are numbered 1,2,3…
2
Rules of Data Flow
⚫ Data can flow from ⚫ Data cannot flow
from
External entity to ⚫ External entity to
process external entity
Process to external ⚫ External entity to
entity store
Process to store and ⚫ Store to external
back entity
Process to process ⚫ Store to store
Common errors in DFD
2
Good Style in Drawing DFD
⚫ Use meaningful names for data flows,
processes and data stores.
⚫ Use top down development starting from
context diagram and successively
levelling DFD
⚫ Only previously stored data can be read
⚫ A process can only transfer input to output.
It cannot create new data
⚫ Data stores cannot create new data
Creating DFDs
⚫ Create a preliminary Context Diagram.
⚫ Identify Use Cases, i.e. the ways in which
users most commonly use the system.
⚫ Create DFD fragments for each use case.
⚫ Create a Level 0 diagram from fragments.
⚫ Decompose to Level 1,2,…
⚫ Validate DFDs with users.
Creating the Context Diagram
⚫ Draw one process
representing the entire
system (process 0)
⚫ Find all inputs and outputs
that come from or go to
external entities; draw as
data flows.
⚫ Draw in external entities
as the source or
destination of the data
flows.
Creating Level 0 Diagram
⚫ Combine the set
of DFD
fragments into
one diagram.
⚫ Generally move
from top to
bottom, left to
right.
⚫ Minimize crossed
lines.
Creating Level 1 Diagram
⚫ Each use case is turned into its own DFD.
⚫ Take the steps listed on the use case
and depict each as a process on the
level 1 DFD.
⚫ Inputs and outputs listed on use case
become data flows on DFD.
⚫ Include sources and destinations of data
flows to processes and stores within the
DFD.
⚫ May also include external entities for
When to stop decomposing
DFDs?
Ideally, a DFD has at
least three levels.
When the system
becomes primitive
i.e. lowest level is
reached and further
decomposition is
useless.
Validating DFD
Student Report
Information 0 Request
Studen Report
t Request
Studen
Informati t Name
1 3 Data
on & ID Item
Admission Perfor Generat Promp
Student Approval or t Staff
m Intak e Dat
Rejection e Dat Report a
Procedur a s Item
e Prior Quer s Repor
Approve Applicatio y Dat t
d n Data a
Applicatio D1 Student
n Data
Verified
Approve
2 d
Applicatio
Maintai n
n Stude Other Student
nt Data
Informati Request for
on Student Information
Maintenance
Level 1 Process 1, Perform Intake Procedure
Studen
t
Informati Admission
on 1. 1.
1 Application 2
Student Receive Verify
Student Admissio
Admissio Name n
n and ID Applicati
Applicatio on
n Verified
Prior Admissio
Applicatio D1 Student n
n Data Data Applicati
Applicatio on
Applicati n
on Data
Reques 1.
Application
t 3
Approval or Approved
Rejection Review
Application
Admissio
n
Applicatio
n
Level 1 Process 2, Maintain
Student
Information
Approved 2.
Application 2
to Add Add
New
Stude Verified
nt Verified Approved
Changed Applicatio
2.
3 Student n
Approved Approved Application to Edit Data
Application 2. Edit
1 Existing
Request for Determi ID of Studen D1 Student Data
Student Information ne Student t
Maintenance 2.
Operatio to 4
n Delete Verified ID
Delet
e of Student to
Existin Delete
g
2.
Stude 5
nt
Determination Cance
to Cancel l
Operation Operatio
n
Logical and Physical DFD
⚫ DFDs considered so far are called logical
DFDs
⚫ A physical DFD is similar to a document flow
diagram
⚫ It specifies who does the operations
specified by the logical DFD
⚫ Physical DFD may depict physical
movements of the goods
⚫ Physical DFDs can be drawn during fact
gathering phase of a life cycle
PROCESS FLOW
A Process Flow Diagram (PFD) represents the
sequence of actions, decisions, and interactions in a
process. Unlike DFDs, which focus on data movement,
PFDs focus on the workflow and procedural steps.
Components of a Process Flow Diagram