data flow diagrams cape computer science unit 2 t.batchelor in collaboration with y.c.lemard

41
DATA FLOW DIAGRAMS CAPE COMPUTER SCIENCE UNIT 2 T.Batchelor in collaboration with Y.C.LeMard

Upload: leticia-picker

Post on 29-Mar-2015

217 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: DATA FLOW DIAGRAMS CAPE COMPUTER SCIENCE UNIT 2 T.Batchelor in collaboration with Y.C.LeMard

DATAFLOW

DIAGRAMS

CAPE COMPUTER SCIENCE UNIT 2

T.Batchelor in collaboration with Y.C.LeMard

Page 2: DATA FLOW DIAGRAMS CAPE COMPUTER SCIENCE UNIT 2 T.Batchelor in collaboration with Y.C.LeMard

Introduction

We’ve learnt that a computer takes in data, processes it, and produces information as output

Data input process Information output

Page 3: DATA FLOW DIAGRAMS CAPE COMPUTER SCIENCE UNIT 2 T.Batchelor in collaboration with Y.C.LeMard

We also know that the processing is really done by a program.

Therefore a program (or a set of programs) receives data, does something to it, and produces information for the user

Introduction

process = program

Page 4: DATA FLOW DIAGRAMS CAPE COMPUTER SCIENCE UNIT 2 T.Batchelor in collaboration with Y.C.LeMard

Introduction

If you think about it carefully you will acknowledge that this is what all the programs you have written up to this point do.

And hopefully this is what your I.A. program will do too.

Page 5: DATA FLOW DIAGRAMS CAPE COMPUTER SCIENCE UNIT 2 T.Batchelor in collaboration with Y.C.LeMard

Introduction

Data input

PROGRAM

Information output

Page 6: DATA FLOW DIAGRAMS CAPE COMPUTER SCIENCE UNIT 2 T.Batchelor in collaboration with Y.C.LeMard

Data Flow Diagrams

A Data flow Diagram (DFD) is a pictorial representation of this flow of data through a computer system.

It is an essential systems analysis and design tool

Page 7: DATA FLOW DIAGRAMS CAPE COMPUTER SCIENCE UNIT 2 T.Batchelor in collaboration with Y.C.LeMard

DFDs

Here is an example of a Data Flow Diagram

Page 8: DATA FLOW DIAGRAMS CAPE COMPUTER SCIENCE UNIT 2 T.Batchelor in collaboration with Y.C.LeMard

DFDs

Here is another example

Page 9: DATA FLOW DIAGRAMS CAPE COMPUTER SCIENCE UNIT 2 T.Batchelor in collaboration with Y.C.LeMard

DFDs

Luckily our DFDs will not need to be so complex.

But from these examples we can isolate the components of a DFD

Page 10: DATA FLOW DIAGRAMS CAPE COMPUTER SCIENCE UNIT 2 T.Batchelor in collaboration with Y.C.LeMard

DFDs

Data Flow Diagrams have 4 symbols

1. Sharp cornered, shadowed rectangles

2. Rounded cornered rectangles

3. Opened sided rectangles

4. Arrows

Page 11: DATA FLOW DIAGRAMS CAPE COMPUTER SCIENCE UNIT 2 T.Batchelor in collaboration with Y.C.LeMard

1. External Entities

The sharp cornered rectangles (or simply boxes) in a DFD indicate entities.

Entities are people, things, organizations, etc outside of the system.

Entities are the source of data and the destination of data.

External EntityExternal Entity

Page 12: DATA FLOW DIAGRAMS CAPE COMPUTER SCIENCE UNIT 2 T.Batchelor in collaboration with Y.C.LeMard

Entities

Student

Teacher

Customer

Doctor

Patient

User

Manager

Cashier

Page 13: DATA FLOW DIAGRAMS CAPE COMPUTER SCIENCE UNIT 2 T.Batchelor in collaboration with Y.C.LeMard

External Entities

As you will have guessed, all external entities must be labeled.

It must be obvious too that every system must have at least one entity

Ms LeMard

Page 14: DATA FLOW DIAGRAMS CAPE COMPUTER SCIENCE UNIT 2 T.Batchelor in collaboration with Y.C.LeMard

2. Processes

The rounded cornered rectangles in a DFD indicate processes.

Processes are the changes that data go through causing it to be transformed gradually into information.

Process

Every computer program is a process

Page 15: DATA FLOW DIAGRAMS CAPE COMPUTER SCIENCE UNIT 2 T.Batchelor in collaboration with Y.C.LeMard

Processes

Accounting system

Marketing system

Shipping system

Grading system

Patient Administration system

Reservation system

Page 16: DATA FLOW DIAGRAMS CAPE COMPUTER SCIENCE UNIT 2 T.Batchelor in collaboration with Y.C.LeMard

Processes

Just like entities all processes must have a name.

Medical Expert System

Also every computer system has at least one process

Page 17: DATA FLOW DIAGRAMS CAPE COMPUTER SCIENCE UNIT 2 T.Batchelor in collaboration with Y.C.LeMard

3. Data Store

File Name

This is a generally accepted sign for a data store (file)

Page 18: DATA FLOW DIAGRAMS CAPE COMPUTER SCIENCE UNIT 2 T.Batchelor in collaboration with Y.C.LeMard

Data Store

Employees’ Data

Accounts Receivable File

Order Details

Students’ Grades

Page 19: DATA FLOW DIAGRAMS CAPE COMPUTER SCIENCE UNIT 2 T.Batchelor in collaboration with Y.C.LeMard

Data Store

A ‘data store’ is a secondary storage device which holds a file.

Most meaningful systems store permanent data in one or more master files. Transactions files are also used in batch processing systems

Page 20: DATA FLOW DIAGRAMS CAPE COMPUTER SCIENCE UNIT 2 T.Batchelor in collaboration with Y.C.LeMard

Data Store

Not every system has a file however, some are totally interactive.

In addition very simple DFDs [ Context Level DFDs ] do not include any data stores

Page 21: DATA FLOW DIAGRAMS CAPE COMPUTER SCIENCE UNIT 2 T.Batchelor in collaboration with Y.C.LeMard

4. Data

The arrows in a DFD show the data. Data must come from somewhere and go to somewhere else. The direction of the arrow indicates this.

All arrows must be labelled to show what particular piece of data is being referred to.

Data

Page 22: DATA FLOW DIAGRAMS CAPE COMPUTER SCIENCE UNIT 2 T.Batchelor in collaboration with Y.C.LeMard

Data

Name

Date

Grade

Amount

Symptom

Page 23: DATA FLOW DIAGRAMS CAPE COMPUTER SCIENCE UNIT 2 T.Batchelor in collaboration with Y.C.LeMard

• Some texts use a circle for the process

• Some texts also use a different sign for the file depending on the type of media on which it is stored.

FYI

Process

Page 24: DATA FLOW DIAGRAMS CAPE COMPUTER SCIENCE UNIT 2 T.Batchelor in collaboration with Y.C.LeMard

We will stick to the symbols below …

Page 25: DATA FLOW DIAGRAMS CAPE COMPUTER SCIENCE UNIT 2 T.Batchelor in collaboration with Y.C.LeMard

Types of DFD

The Top-Down approach is taken to the design of DFDs.

Data flow diagrams are therefore classified by levels. Each subsequent level indicates greater details.

Page 26: DATA FLOW DIAGRAMS CAPE COMPUTER SCIENCE UNIT 2 T.Batchelor in collaboration with Y.C.LeMard

Levels

Level 0 DFD

The Level 0 DFD (also known as the Context Level DFD) is the simplest DFD. This diagram shows a single process and all external entities which interact with this process, and the data flowing to and from the process.

Page 27: DATA FLOW DIAGRAMS CAPE COMPUTER SCIENCE UNIT 2 T.Batchelor in collaboration with Y.C.LeMard

Context Level DFD for a Mail Order Business

Customer Order Processing

Order

Delivery

Page 28: DATA FLOW DIAGRAMS CAPE COMPUTER SCIENCE UNIT 2 T.Batchelor in collaboration with Y.C.LeMard

Decomposition

Level 1 DFDs

A Context Level DFD is broken down (exploded) into a set of processes, the data moving between these processes, the entities interacting with these processes and the data stores.

Page 29: DATA FLOW DIAGRAMS CAPE COMPUTER SCIENCE UNIT 2 T.Batchelor in collaboration with Y.C.LeMard

Level 1 DFD for a Mail Order Business

Customer Sales processing

Order

Delivery

Accounting System

Customer Database

OrderCredit Status

Orders

Order

Credit Status

Customer number

Page 30: DATA FLOW DIAGRAMS CAPE COMPUTER SCIENCE UNIT 2 T.Batchelor in collaboration with Y.C.LeMard

Decomposition

Level 2 and other Level DFDs

Each process from Level 1 is exploded even more into sub processes. This decomposition continues for each subsequent level. The number of levels possible depends on the complexity of the system.

Page 31: DATA FLOW DIAGRAMS CAPE COMPUTER SCIENCE UNIT 2 T.Batchelor in collaboration with Y.C.LeMard

The Value of a DFD

With a dataflow diagram, users are able to visualize how the system will operate, what the system will accomplish, and how the system will be implemented.

Dataflow diagrams can be used to provide the end user with a physical idea of how the data they input ultimately has an effect upon the structure of the whole system.

Page 32: DATA FLOW DIAGRAMS CAPE COMPUTER SCIENCE UNIT 2 T.Batchelor in collaboration with Y.C.LeMard

The Value of a DFD

The old system's dataflow diagrams can also be drawn up and compared with the new system's dataflow diagrams to draw comparisons in order to help implement a more efficient system.

Page 33: DATA FLOW DIAGRAMS CAPE COMPUTER SCIENCE UNIT 2 T.Batchelor in collaboration with Y.C.LeMard

Context Level DFD for a Payroll System

SupervisorSupervisor

Payroll System

Hours worked

Pay cheque

EmployeeEmployee

Personal Data

Page 34: DATA FLOW DIAGRAMS CAPE COMPUTER SCIENCE UNIT 2 T.Batchelor in collaboration with Y.C.LeMard

Level 1 DFD for a Payroll System

SupervisorSupervisor

EmployeeEmployee

Batching system Personnel system

SalaryGeneration

System

Employee Database

Accounting data

Hours

worked

PersonalData

Employeerecord

Hoursworked

Paycheques

Accountingdetails

Accountingdetails

Employeepersonaldata

Page 35: DATA FLOW DIAGRAMS CAPE COMPUTER SCIENCE UNIT 2 T.Batchelor in collaboration with Y.C.LeMard

How to Create A Level 0 Data Flow Diagram

1. Identify your main system’s focus

2. Identify the external people/ organisations who interact with the system

3. Decide what data these entities will enter into the system

4. Determine what these entities expect as output from the system

Page 36: DATA FLOW DIAGRAMS CAPE COMPUTER SCIENCE UNIT 2 T.Batchelor in collaboration with Y.C.LeMard

How to Create A Level 1 Data Flow Diagram

1. Focus on your process and break it into 2 or more sub-processes

2. Identify what data flows between these processes and between the entities

3. Identify what permanent data files are used in this system.

4. Note that no new entities can be introduced

Page 37: DATA FLOW DIAGRAMS CAPE COMPUTER SCIENCE UNIT 2 T.Batchelor in collaboration with Y.C.LeMard

BEWARE

1. Data can not flow directly from file to file.

2. Data can not flow directly from entity to entity

3. No process can have no input data yet have output data, that would be a miracle.

4. No process can have input data yet have no output data, that would be a black hole.

Page 38: DATA FLOW DIAGRAMS CAPE COMPUTER SCIENCE UNIT 2 T.Batchelor in collaboration with Y.C.LeMard

Your Questions ?

Page 39: DATA FLOW DIAGRAMS CAPE COMPUTER SCIENCE UNIT 2 T.Batchelor in collaboration with Y.C.LeMard

Questions

1. What is the purpose of a data flow diagram?

2. What 4 symbols are used in a DFD?

3. Which symbols must appear on every DFD?

4. Every process must have data going in and data coming out. Why?

Page 40: DATA FLOW DIAGRAMS CAPE COMPUTER SCIENCE UNIT 2 T.Batchelor in collaboration with Y.C.LeMard

Exercise

1. Draw a Level 0 Data Flow Diagram for the following situation:

A travel agency takes calls from clients, checks seat availability on the flights they desire and makes a reservation for them if all is clear.

2. Explode your Context Level diagram into a Level 1 DFD

Page 41: DATA FLOW DIAGRAMS CAPE COMPUTER SCIENCE UNIT 2 T.Batchelor in collaboration with Y.C.LeMard

~~ T h e E N D ~~