Component DFD
Component DFD
Component DFD
Vol. 2, Nos. 1-2, January-December 2012, pp. 69– 77 © International Science Press
Abstract: Data flow diagrams (DFDs) reveal relationships among and between the various
components in a program or system. DFDs are 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. DFDs consist of four major
components: entities, processes, data stores, and data flows. The symbols used to depict
how these components interact in a system are simple and easy to understand; however,
there are several DFD models to work from, each having its own symbology. In this
paper we have given steps for abstraction of data flow diagram for a ‘C’ program by
taking student record as a case study.
Keywords: DFD, Abstraction, Context diagram, OMT.
1. INTRODUCTION
Data flow diagrams have[1] replaced flowcharts and pseudo code 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. A DFD is illustrated in Figure 1
Figure 1: Example
1
DAssistant Professor, Department Of Computer Science, SKSVMACET, Laxmeshwar-582116,Dist-Gadag
2*
Corresponding Author Lecturer, Department Of Computer Science, SKSVMACET, Laxmeshwar-582116,
Dist-Gadag,
70 International Journal of Operations System and Human Resource Management
11. Identify or list each incoming and outgoing data flow with a corresponding process that receives
generates data.
12. Make sure you refer to your data item table for any missing internal data flows and to identify
data stores. [If your table contains documents with the same source and destination, so select
only one flow]
13. Identify these processes that only address internal output and outputs and use one process for
each source or destination from the DFD.
14. Revising the Level 1 DFD.
(a) Check that level1 processes correspond with the major functions.
(b) Check level of detail balanced across the DFD.
(c) Check that it is possible to merge some processes.
(d) Check that it is possible to remove data stores not shared by more than one processes.
(e) Check that it is avoided crossed data flow lines making use of duplicated components
[ external entities and data stores] or not.
15. Terminate.
#include<stdio.h>
#include<process.h>
#include<string.h>
typedef struct
{ int usn;
char name[20];
int marks1; int marks2; int marks3;
}STUDENT;
void main()
{
STUDENT st;
char fname[10];
FILE *fp;
Abstraction of Data Flow Diagram for a C Program 73
int key_usn;
int flag;
int choice;
printf(“enter the file name\n”);
scanf(“%s”,fname);
for(;;)
{
printf(“1:insert Record 2: Search record 3: Display record 4: Quit\n”);
scanf(“%d”,&choice);
switch(choice)
{
case 1: fp=fopen(fname,“a+”);
if(fp==NULL)
{
printf(“Fopen failed\n”); break;
} Append_record();
fclose(fp); break;
case 2:fp= fopen(fname,“r”);
if(fp==NULL)
{
printf(“File open failed\n”); break;
}
printf(“Enter USN:”);
scanf(“%d”,&key_usn);
flag=search_record(key_usn, fp);
if(flag==0)
printf(“unsuccessfull search\n”); else
printf(“successful search\n”); fclose(fp);
break;
case 3:fp=fopen(fname,“r”);
if(fp==NULL)
{
printf(“File opened failed\n”);
break;
}
74 International Journal of Operations System and Human Resource Management
display_records(fp);
fclose(fp);
break;
default: exit(0);
}
}
int search_record(int key_usn, FILE *fp)
{
STUDENT st;
for(;;)
{
fscanf(fp,“%d,%s,%d,%d,%d”,&st.usn,st.name,&st.marks 1,&st.marks2,&st.marks3); if((feof(fp))
break;
if(key_usn==st.usn)
return 1;
}
return 0;
}
void append_record(FILE *fp)
{
STUDENT at;
printf (“USN:”);
scanf(“%d”,&st.usn);
printf(“name”);
scanf(“%d”,&st.usn);
printf(“marks1:”);
scanf(“%d”, &st.marks1);
printf(“marks2”);
scanf(“%d”,&st.marks2);
printf(“marks3”);
scanf(“%d”,&st.marks3);
fprintf(fp,“%d,%s,%d,%d,%d”,&st.usn,st.name,&st.marks1 ,&st.marks2,&st.marks3);
}
void display_records(FILE *fp)
{
Abstraction of Data Flow Diagram for a C Program 75
STUDENT st;
printf(“USN NAME MARKS1 MARKS2 MARKS 3”);
for(;;)
{ fscanf(fp,“%d,%s,%d,%d,%d”,&st.usn,st.name,&st.marks1 ,&st.marks2,&st.marks3);
if(feof(fp))
break;
printf(“%d,%s,%d,%d,%d”,st.usn,st.name,st.marks1,st.mar ks2,st.marks3);
}}
Source Destination
User append_record
append_record student_record
user display_record
student-record display_record
user serach_record
student-record serch_record
12. Make sure that we referring to these data item table for any missing internal data flows and to
identify data store.
13. The processes
→ append_record
→ display_record
→ search_record
The generated DFD for above steps is shown in Figure 4.
4. CONCLUSION
Data flow diagramming is a highly effective technique for showing the flow of information through
a system. DFDs are used in the preliminary stages of systems analysis to help understand the current
system and to represent a required system. We have given steps for abstraction of DFD for ‘C’
program, verified these steps for case study and also given brief steps for object oriented analysis.
DFDs are extremely useful in systems analysis as they help structure the steps in object-oriented
design and analysis. Because DFDs and object technology share the same syntax constructs, DFDs
are appropriate for the OO domain only.
REFERENCES
[1] Perry, Greg. Sams Teach Yourself Beginning Programming in 24 Hours, Sams Publishing, 1998.
[2] Le Vie, Jr., Donald, “An eCommerce Primer for Technical Communicators”, STC Proceedings of
the 47th Annual Conference, 2000. Donald.