Data Flow Diagram
Data Flow
Diagram(DFD)
►DFD is a graphical representation of the "flow" of data through a process or an
information system, used for the visualization of data processing.
►Data flow diagrams (DFDs) reveal relationships among and between the various
components in a program or system.
►An important technique for modeling a system’s high-level detail by showing how input
data is transformed to output results through a sequence of functional
transformations.
►quite different from a flowchart, which shows the flow of control through an algorithm.
►show what kinds of data will be input to and output from the system, where the data
will come from and go to, where the data will be stored.
2
Data Flow
Diagram(DFD)
The DFDs are used to:
discuss with the user a diagrammatic interpretation of the processes in the
system and clarify what is currently being performed
determine what the new system should be able to do and what information is
required for each different process that should be carried out
check that the completed system conforms to its intended design
3
Types of DFD
◘ Data Flow Diagrams are either Logical or Physical.
◘ Logical DFD - concentrates on the system process, and flow of data in the
system. For example in a Banking software system, how data is moved between
different entities.
◘ Physical DFD - shows how the data flow is actually implemented in the
system. It is more specific and close to the implementation.
4
Elements of
data-flow diagrams
Four basic elements are used to construct data-flow diagrams:
(1) entities
(2) processes
(3) data stores
(4) data flows
entity process data stores data flows
5
Entity
Entities are source and destination of information data.
Entities are represented by a rectangles or circle with their respective names.
Things that are identified as needing to interact with the system under
consideration.
Either input information to the system or output information from the system or
both.
May represent job titles or other systems that interact with the system to be built.
Student
6
Process
Activities and actions taken on the data that flows around the system are represented
by Circle or Round-edged rectangles.
accepts input data needed for the process to be carried out and produces data that it
passes on to another part of the DFD.
Process names must be well chosen to give a precise meaning to the action to be
taken.
It is good practice to always start with a strong verb and to follow with not more than
four or five words.
Examples of good process names would be :
Enter customer details Register
Register
New
Register new students New
Students
Validate sales orders Students
Try to avoid using the verb ‘process’
7
Data
Storage
☼ places where data may be stored.
☼ stored either temporarily or permanently by the user.
☼ There are two variants of data storage.
☼ can either be represented as a rectangle with absence of both smaller sides or as
an open-sided rectangle with only one side missing.
☼ How many data stores you place on a DFD somewhat depends on the case study.
Data store identifier Data store description
Student Information File
As data stores represent a person, place or thing they are
named with a noun.
8 Each data store is given a unique identifier D1, D2 D3 etc.
Data Flow
The previous three symbols may be interconnected with data flows.
These represent the flow of data to or from a process.
The symbol is an arrow.
Data movement is shown from the base of arrow as its source towards head of the
arrow as destination.
There are some interconnections, though, that are not allowed.
Between a data store and another data store
Between an external entity and a data store
It is unusual to show interconnections between external entities.
9
Key Points for making DFD
All the data flows are labeled and describe the information that is being carried.
It tends to make the diagram easier to read if the processes are kept to the middle, the
external entities to the left and the data stores appear on the right hand side of the
diagram.
The process names start with a strong verb.
Each process has access to all the information it needs.
Each process should have an output. If there is no output then there is no point in having
that process.
Data stores should have at least one data flow reading from them and one data flow
writing to them.
If the data is never accessed there is a question as to whether it should be stored.
Data may flow from
▲ External entity to process and vice-versa
▲ Process to process
▲ Process to data store and vice-versa
10
The benefits of DFD
Data-flow diagrams provide a very important tool for software engineering, for a
number of reasons.
The system scope and boundaries are clearly indicated on the diagrams.
The technique of decomposition of high level data-flow diagrams to a set of more
detailed diagrams, provides an overall view of the complete system, as well as a
more detailed breakdown and description of individual activities, where this is
appropriate, for clarification and understanding.
11
Types of DFD
Data flow diagrams have replaced flowcharts and pseudocode as the tool of
choice for showing program design.
A DFD illustrates those functions that must be performed in a program as well as
the data that the functions will need.
Data flow diagrams can be expressed as a series of levels.
12
Types of DFD
There are three main types of data-flow diagram:
(1) Context diagrams
Context diagram DFDs are diagrams that present an overview of the system
and its interaction with the rest of the “world”.
(2) Level 1 data-flow diagrams
Level 1 DFDs present a more detailed view of the system than context
diagrams, by showing the main sub-processes and stores of data that make up
the system as a whole.
(3) Level 2 data-flow diagrams
The detailed complexity of real world systems can be managed and modeled in a
hierarchy of abstractions.
Certain elements of any data flow diagram can be decomposed into a more
detailed level lower in the hierarchy
13
0
Name D1 Name Name
Name
Process Data Flow Data Store External Entity
Symbols of DFD Elements
14
Estate Agency case study
Clients wishing to put their property on the market visit the estate agent, who will
take details of their house, flat or bungalow and enter them on a card which is filed
according to the area, price range and type of property.
Potential buyers complete a similar type of card which is filed by buyer name.
Weekly, the estate agent matches the potential buyer's requirements with the
available properties and sends them the details of selected properties.
When a sale is completed, the buyer confirms that the contracts have been
exchanged, client details are removed from the property file, and an invoice is sent to
the client. The client receives the top copy of a three-part set, with the other two copies
being filed.
On receipt of the payment the invoice copies are stamped and archived. Invoices
are checked on a monthly basis and for those accounts not settled within two months a
reminder (the third copy of the invoice) is sent to the client.
14
19