You are on page 1of 62

(DFD)

What is data flow diagram?


A data flow diagram is a network representation of a system. The data flow diagram portrays the system in terms of its components pieces with all interfaces among the components indicated. Tom DeMarco A structured analysis technique that employs a set of visual representations through the organization
2

What is data flow diagram?


DFDs model events and processes (i.e. activities that transform data) within a system. DFDs examine how data flows into, out of and within the system One of the most important analysis tools for analysing data-oriented systems A simple way of representing information flows A means of representing both business processes and system solutions A means of system scoping Data can be understood as any thing (e.g. raw Data materials, filed information, ideas, etc.) 3

DATA FLOW DIAGRAM

What is data flow diagram?


In SSADM, DFDs are used to answer the following data-oriented questions about a target system:
What processing is done? When? How? Where? By whom?

What data is needed? By whom? for what? When?


4

DATA FLOW DIAGRAM

What is data flow diagram?


In SSADM, DFDs are used to describe the target system in different ways;e.g. What the system does? How is does it?
What it should do? How it should do it?
5

Data Flow Diagram shows


the processes within the system

the data stores (files) supporting the system's operation the information flows within the system the system boundary
6

interactions with external entities


*

Why Data Flow Diagram?


Diagram the organization or the system Diagram the current or proposed situation Facilitate analysis and design Bridge analysis and design Communicate with all users at all stage
7

Data Flow Diagram Principles


The general principle in data flow diagramming is that a system can be decomposed into subsystems, and subsystems can be decomposed into lower level subsystems, and so on Each subsystem represents a process or activity in which data is processed. At the lowest level, processes cant be decomposed Each process in a DFD has the characteristics of a system Just as a system must have input and output, so a process must have input and output Data enter the system from environment; data flows between processes within the system and data is produced as output from the system
8

DFD Characteristics
Graphics

Partitioned Multidimensional Emphasize flow of data De-Emphasize flow of control

What Is Not in DFD


Dynamics of system behavior

Timing Control Particular input/output storage media


9

Various Types of DFD


Current how data flows now Proposed how wed like it to flow Logical the essence of the process
Show how the business operates Processes are independent of the system implemented

Physical the implementation of the process


Show how the system operates (or will be implemented) Processes show how the system will be implemented
10

Data Flow Diagramming Mechanics Not procedural Do not try to represent conditional processing or loops. Simply shows the flow of data Provides a mechanism for information flow modeling and functional modeling Often better than English narrative
11

Data Flow Diagramming Mechanics (contd.) Four Basic elements or symbols are used External Entity (Supply data to or use data from the system) Data flow ( Data movement model the passage of data in the system) Process (What the system should do?) Data store (Repositories of data) Two different standard sets can be used DeMarco and Yourdon Gane and Sarson
12

Gane and Sarson Symbols


External Entity
Example
Customer

Data Flow

Process Data Store

Get Price

Unit price Record Price

D Customer File 7
13

DeMarco and Yourdon Symbols


External Entity
Example
Customer

Data Flow

Process Data Store

5 Get Price

Unit price

6 Record price

Customer File
14

External Entity

External Entity

depicts the origin (source) and/or destination (sink) of

data Cust its name implies it is external to the system and hence o P1 outside the system boundary Cust P1 because they are external, many characteristics are not of interest to us Cust each entity to be labeled with an appropriate name using noun the same entity can be used more than once on a given data flow diagram to avoid crossing data flow lines could be a department, a business, a person, a machine, or another system, etc.
15

Data Flow depicts data that are in motion and moving as a unit
Representsplace to another in the system. thing from one data about a person, place, or and should described with the same process it cannot go directly back to a noun leaves Direction
discouraged

Data Flow

information always flows to or from a process and Do not use may be verbal, written, or electronic
A data flow to a data store means update For A data flow from a data store means retrieve or use A data flow has only one direction of flow between only one direction
symbols
16

Process
Process

depicts work or action performed on data so

17

that they are transformed or manipulated, stored or distributed must be given a unique identifying number indicating its level within the diagram must be described with a verb must have a unique name several data flows may go into or come out of each process
*

Data Store
Data Store depicts data at rest
(i.e. holding place for information within the system may represent a manual store filing cabinet notebook computerized file or database may be long term files, such as sales ledgers may be short tern accumulations (temporary), for example batches of documents that are waiting to be processed must be described with a noun

18

Data Stores (Gane and Sarson Symbols)


Data Stores are some location where data is held temporarily or permanently. In physical DFDs there can be 4 types.
D = computerized Data
M = Manual, e.g. filing cabinet T = Transient data file, e.g. temporary program file T (M) = Transient Manual, e.g. in-tray, mail box.
19

Additional Data Flow Symbols


Real-time Link
Comm. back and forth between external agent and a process as the process is executing e.g. Credit card verification

Resource flow

shows flow of physical material from its source to its destination referred to as physical physical flows are usually restricted to early, high level diagrams and are used when a description of the physical flow of materials is considered to be important to help the analysis
*

20

Decomposition of DFDs
Functional decomposition
Act of going from one single system to many component processes Repetitive procedure Lowest level is called a primitive DFD

Level-N Diagrams
A DFD that is the result of n nested decompositions of a series of sub-processes from a process on a level-0 diagram
21

B F F4 A A V F1 W F3

Fig : Exploded DFD

F2

X F4 Z Z1 F5

F6 Z2 Z3 F7 B

F4 1 F4 2

X1

F4 3 F4 4

X2
F4 5 Y2

Y
22

Y1

Context Diagram is the highest level DFD

has only one process the System shows the summary of the whole system environment system boundaries shows scope of an organizational system the general system where the organizations business process fits
23

shows major information flows between the entities and the system shows the interactions with external environments has no internal operation details hides the system complexity Exception: A data store can has no data stores be shown on context, In case if the system is using a data store of another system (in the internal to the [it can be shown as an external entity system external environment)
24

Context Diagram (contd.)

users, interfaces, subsystems

as well] *

Context Diagram
Input A

Input - A

Entity 1
System Name
Output - C

Entity 3

Input B

Entity 2

Input - B

An example context diagram


25

Context Diagram
Input A

- Food ordering system

Input B

26

Claim with Insurance Because they will make decisions independently of Symptoms, treatment costs Company Patient info, the system on the basis of information both outside and type Insurance info, the system and within it. They initiate a transaction Payments Payment or Patient and change information within the system based on rejected claim Patient Information this outside knowledge System Bills, Medical info, Receipt Patient info

Context Diagram

Updated Why would the referring doctors in the Patient info context diagram be an external entity?

Referring Doctors or Hospitals

27

Patient Information System in a Hospital

Level 0 Diagram
Show all the major processes that comprise the overall system, data flows and data stores at a high level of detail. These processes are numbered, 1,2,3, etc. These processes are often packages of related processing and often are treated as separate systems (sometimes called subsystems) Adds data stores - a collection of data that is stored in some way. Is described with a noun. Data stores are the DFDs representation of the ERD
28

Level 0 Diagram
Entity Input A 1 1 General Process AAA Data Flow 2 Output C B General Process Data BBB Flow C Record E D2 Data Store 2 Entity 3

Record A

D1 Data Store 1 Record A Entity 2 3 Input B General Process CCC

Record E
4 General Process DDD

Data Flow C

29

Context diagram can be exploded into diagram 0

Level 0 Diagram - Food ordering system

30

Level 1 Diagram
Show all the processes that comprise a single process on the level 0 diagram. These processes are numbered with the parent processs number, followed by a . and a sequential number: 1.1, 1.2, 1.3 Shows how information moves from and to each of these processes Shows in more detail the content of higher level process Level 1 diagrams may not be needed for all level 0 processes
31

Level 2 Diagram
Shows all processes that comprise a single process on the level 1 diagram Shows how information moves from and to each of these processes Level 2 diagrams may not be needed for all level 1 processes Correctly numbering each process helps the user understand where the process fits into the overall system

32

Atomic or Leaf Process


The lowest level of activity decomposition (The bottommost process ) that Each atomic process does only one thing Later many will become a program or be combined with other atomic processes to become programs Has discrete, detailed activities or tasks required to complete the response to an event.

33

When to stop decomposion?


When each process has been reduced to a single decision, calculation or database operation When each data store represents data about a single entity When a process can be When the system user does not care to see described with an any more detail

Elementary Process

34

Balancing DFDs
When decomposing a DFD, you must conserve inputs to and outputs from a process at the next level of decomposition. All information shown in previous level DFD is accurately represented in its next level In other words, number of external input/ output data flows for any diagram must be the same in the next level
35

Balancing DFDs
Source 0 Process Context diagram
A
A
1.0

Sink

Source One
C

Process
1

Source Two

Formatted A
2.0

Formatted C B

Process 2

Sink

An unbalanced set of data flow diagram - Level-0 diagram


36

Balancing DFDs
One input to the system The customer order
Same input No new inputs or outputs have been introduced We can say that the context diagram and level-0 DFD are balanced

Three outputs
Customer receipt Food order Management reports

24
37

28

Balancing DFDs - Four rules


A composite data flow on one level can be split into component data flows at the next level, but data can neither be add nor deleted.

The inputs to a process must be sufficient to produce the outputs


At the most detailed level of DFDs, new data flows may be added to represent data that are transmitted under exceptional circumstances (error messages, confirmation dialogues, etc.) You may repeat symbols to avoid crossing data flow lines.
38

Common Errors - Data Flows


Process Process Source Data Store Source Data

We do not model flows between external entities

WHY?
(we have no control over them)
39

Common Errors
All processes must have both input and output data Data direction arrows for data flows labelling Cluttered diagrams - aim for 3-9 processes Omitting data flows Inputs and outputs for each parent process must correspond exactly to those on child diagrams (except for minor flows such as error messages) Putting technical process details on a logical DFD
40

Common Errors

Watch Out For


Black holes Data goes into a process but doesnt comes out Miracles

A process produces output without input


41

Common Errors - Black holes


Data goes into a process but doesnt comes out

A, B ,C, X

Compute X

Process Specification If A > 5 Then X = X * 1.05 Else X = X * 1.10 Endif


42

Common Errors - Miracles


A process produces output without input
A

Compute X

A. B, Y

Process Specification If A > 5 Then Y = 50 Else Y = 100 Endif


43

Common Errors
Attendance M Register
Attendance Data

Validate Attendance

D Attendance Data DEO Atd. Data


Attendance Register

Atd. Data

Attendance Data

Attendance ENTRY

Validate Attendance
*

44

Common Errors
Level n-1

Level n

Decomposition is not proper


45

Four Different Types of DFDS

Current Physical Current Logical New Logical New Physical


46

Current Physical
Process label includes an identification of the technology (people or systems) used to process the data Data flows and data stores are labeled with the actual name of the physical media on which data flow or in which data are stored
47

Current Logical
Physical aspects of system are removed as much as possible Current system is reduced to data and processes that transform them

48

New Logical
Technology independent Includes additional functions Obsolete functions are removed Inefficient data flows are reorganized Shows data flows, structures, and functional requirements of the new system
49

New Physical
Represents the physical implementation of the new system

50

Four Different Types of DFDS


indicative (existing system) Abstract (essential functions) optative (new system)

ADD 2. Current physical logical system processes


1. Current Add new physical features system

3. New logical system 4. New physical system


*

Remove all Concrete purely (detailed physical model) processes


51

Example Logical Data Flow Diagram


Customer
D1 Prices Items to Purchase 1 Identify Item Item ID 2 Look Up Prices Prices Customer

Payment

Receipt 4

3
Items and Prices Compute Total Cost of Order

Amount to be Paid

Settle Transaction and Issue Receipt

52

Customer

D1

UPC Price File


Item Desc and Prices

D1

Temp Trans File

Customer
Check, Cash. or Debit Crad

Items to Purchase

UPC Code

Items and Prices

Items, Prices, and Subtot als


3

Cash Receipt

1 Pass Items over Scanner (Manual)

UPC Bar Code

2
Look Up Code and Price in File

Items and Prices

Amount to be Paid

4 Collect Money and give Receipt (Manual)

Compute Total Cost

53

Physical Data Flow Diagram


*

Two approaches :
Start with DATA FLOWS

Start with PROCESSES

54

Start with DATA FLOWS


Step 1: Identify the Input & Output flows Step 2: Analyze the logical grouping of the data flows Step 3: Define the processes and data stores needed to transform the data flows and retain the data
55

Start with DATA FLOWS


Step 1:
Identify the Input & Output flows

Step 2:
Analyze the logical grouping of the data flows

Step 3:
Define the processes and data stores needed to transform the data 56 flows and retain the data

Start with PROCESSES


Step 1: Identify the Process Input & Output Step 2: Connect the processes
B A

B A
C

C D

57

Comparison

Start with DATA FLOW


IS GOOD FOR MODELLING AN EXISTING SYSTEM
- especially when we are modelling its physical operation

Start with PROCESSES


IS USUALLY GOOD WHEN STARTING TO BUILD A NEW SYSTEM OR A LARGE SYSTEM
58

Developing Data Flow Diagrams


1. Make a list of business activities and use it to determine various external entities data flows processes data stores 2. Create a context diagram which shows external entities and data flows to/from the system. Do not show any detailed processes or data stores.
59

Developing Data Flow Diagrams


3. Draw diagram 0, the next level. Show processes, but keep them general. Show data stores at this level. 4. Create a child diagram for each of the processes in Diagram 0. 5. Check for errors and make sure the labels you assign to each process and data flow are meaningful.
60

Developing Data Flow Diagrams


6. Develop a physical data flow diagram from the logical data flow diagram. Distinguish between manual and automated processes, describe actual files and reports by name, and add controls to indicate which processes are complete or errors occur. 7. Partition the physical data flow diagram by separating or grouping parts of the diagram in order to facilitate programming and implementation.
61

Ideally, a DFD is self-explanatory, complete and unambiguous


62