Você está na página 1de 2

Data Flow Diagram Cheatsheet

DFD Notation 2008 http://www.robertyu.com Formatting

Process: transform data OR implement state machine


3.2 - action (verb) label
Detect - numbered to indicate hierarchy, but not execution order
Carrier - state machine modeled by statechart Hierarchical, nested diagrams

Top-level diagram is "Context diagram"


samples Data Flow: movement of data
- single or double ended
- labelled
samples
Avoid clutter:
enable Control Flow: binary events, e.g. interrupt - 7 2 process bubbles per page (Miller's Magical Number 7)
- single or double ended - corollary: make your diagrams fit on a standard sheet of paper
- labelled - Cleaner architecture, better (readable, maintainable) software!
enable
- Partition/encapsulate as necessary
Data Store: data at rest
- label indicates contents
filter state - may represent a static variable, file, database, etc.
- often not necessary for model, but useful for clarification

A/D Terminator: an external entity, outside


Frontend the modeled system
- interacts with the modeled system

Statechart Data Flow versus Sequence


- A DFD shows how data moves between process bubbles.
- Numbering does not indicate order of execution

eventName [guard expression] - A DFD does NOT show sequence (procedural) details, like
start
- What is the order of execution?
date!=birthday / - What initiates data transfer between process bubbles?
date++ - Statecharts and control flows do indicate sequencing of bubbles

State A transition action - Think of a DFD like a TRAIN MAP:


- the map doesn't indicate exactly when the train arrives or leaves, but it does tell you how to
get from point A to B

date!=birthday / Logical Consistency


date++ - Avoid data sinks: bubbles or data stores with inputs but no inputs are incorrect
date==birthday /
celebrate - Beware spontaneous generation bubbles: bubbles with outputs but no inputs are probably
incorrect (correct example: random number generator)
- Use statechart to model state machine behavior - Balanced data flows: data and event flows into Bubble X should be represented in the blow-up
State B diagram for Bubble X
- Inputs are outputs of other processes
- Outputs are data flows or control flows

- Make life easy for yourself: References


Ed Yourdon's Structured Analysis Wiki, Chapter 9: http://yourdon.com/strucanalysis/wiki
associate state machine actions with exit
date==birthday /
transitions, not entrance transitions or state Ward & Mellor, Structured Development for Real-time Systems, Upper Saddle River, NJ:
date++
actions Prentice-Hall, 1985.
This DFD describes a system a
which accepts blocks of samples X LPF ()2
d[n]
x[n:n+N] and tries to detect the
A/D frontend a to receiver
presence of a carrier sinusoid with b Detector
frequency F. The signal is x[n:n+N] + ------- > T
logic
downconverted and passed through a - 1+b
LPF, then the ratio of in-band vs out- e-j2F ()2
of-band energy is computed.
If the ratio exceeds threshold T for
N consecutive samples, then the
detector logic indicates TRUE (carrier Detect Carrier (Top Level)
detected), and FALSE if the ratio falls baseband baseband energy
below T for N samples. samples
5
Calc detector ratio
Context Diagram carrier samples LPF 3 carrier
Thresh detected
samples detected 2 Energy
old
Mix to
Detect baseband 1
Sample Demod/ 4
Carrier Calc
Source Receiver Detector
Total State
Energy Machine
The context diagram shows how the total energy
system interacts with terminators - Processes are numbered
Sample Source and Demod/Receiver - Numbers do not indicate order of execution
-Output Carrier Detected is a control - 7 2 process bubbles per diagram!
flow/event (dashed line) - Hierarchical diagrams: processes encapsulate more detail

5 Calc Low Pass Filter 4 Detector State Machine


Energy start - Statechart models behavior of Carrier
All flows are labelled Detector State Machine
- Input is data flow detector ratio
- Output is control flow carrier detected
- Actions associated with exit transitions
Aint No
baseband No Signal /
LPF Output Carrier
baseband energy Count=0
samples
2008 http://www.robertyu.com

Signal & Count < N / Pigeons


5.1 Count++
Low 5.2
Pass Compute
FIR Energy Signal & Count >= N /
Count=0

No Signal & Count >= N /


All processes are
Count=0
labelled and
Filter State numbered
Yes There is
a Carrier No Signal & Count < N /
- Process numbers indicate upper level process 5 Calc LPF Energy Pigeon Count++
- Data flows are labeled
- Data store Filter State retains FIR state between sample blocks No Signal & Count < N /
Count++

Você também pode gostar