structure_charts
A structure chart is a hierarchy chart
that shows
the data
and control
information flows between the modules.
(Figure 63.1 shows a partial structure chart.)
Each module
is represented as a rectangle.
Each data flow (or data couple)
is shown as an arrow
with an open circle at the origin end.
A control couple (a flow of control information such as a flag or a switch setting)
is shown as an arrow
with a solid circle at the origin end,
see the control couple labeled Reorder flag between Process sale and Process transaction in Figure 63.1.
(Note: In this program design,
Initiate reorder is an independent (not shown) level-2 module
called by Process transaction when the Reorder flag is set.)
As appropriate,
the names of
the data elements,
data composites, and/or
control fields
are written alongside the arrows.
A structure chart
does not show
the program’s
sequence,
selection, or
repetitive logical
structures;
those details
are inside the modules,
which
are viewed as black boxes.
However,
some designers
identify
high-level case structures
by adding
a transaction center
to
a key control module.
For example,
the solid diamond
(the transaction center symbol)
at the bottom of
the Process transaction module
indicates that,
based on the transaction type,
either
Process sale,
Process customer return, or
Process shipment arrival
is called.
A data couple
might list
a composite item;
for example,
Get data
passes
a complete transaction
and
the associated master record
back to
Process transaction.
Higher-level modules
generally select
substructures
or
specific data elements
from
a composite
and
pass them down to
their children.
At the bottom of the structure,
the detailed computational modules
accept
and
return
data elements.
The structured program designer’s objective
is to define
independent,
cohesive,
loosely
coupled
modules.
Coupling is
a function of
the amount of
data and control information
flowing between two modules,
and
the structure chart
graphically shows
the data and control flows.
An excessive number of
data or control flows
suggests
a poor design
or
a need for further decomposition.