You are on page 1of 3

Degree of systematization

The data structure design method can reasonably claim to be the most systematic
design method currently available. It consists of a number of distinct steps, each
of which produces a definite piece of paper. The following claims have been made
the method:
_ non-inspirational use of the method depends little or not at all on invention or
_ rational it is based on reasoned principles (structured programming and
structure based on data structure)
10.6 _ Discussion
10.6 Discussion 135
_ teachable people can be taught the method because it consists of well-defined
_ consistent given a single program specification, two different people will come
with the same program design.
_ simple and easy to use
_ produces designs that can be implemented in any programming language.
While these characteristics can be regarded as advantages, they can also be seen as
challenge to the traditional skills associated with programming. It is also highly
to say that data structure design is completely non-inspirational and rational.
In particular, some of the steps arguably require a good deal of insight and
for example, drawing the data structure diagram, identifying the elementary
and placing the operations on the program structure diagram.
Data structure design is most applicable in applications where the structure of the
(input or output) data is very evident. Where there is no clear structure, the method
falls down.
For example, we can assess how useful this method is for designing computational
programs by considering an example. If we think about a program to calculate the
square root of a number, then the input has a very simple structure, and so has the
They are both merely single numbers. There is very little information upon which

to base a program structure and no guidance for devising some iterative algorithm
calculates successively better and better approximations to the solution. Thus it is
unlikely that data structure design can be used to solve problems of this type.
The role of data structure design
Data structure designs strong application area is serial file processing. Serial files
are widely
used. For example, graphics files (e.g. JPEG and GIF formats), sound files (e.g.
files sent to printers (e.g. PostScript format), Web pages using HTML, spreadsheet
and word processor files. Gunter Borns book (see Further Reading) lists hundreds
(serial) file types that need the programmers attention. So, for example, if you
needed to
write a program to convert a file in Microsoft format to an Apple Macintosh
format, data
structure design would probably be of help. But perhaps the ultimate tribute to the
method is the use of an approach used in compiler writing called recursive descent.
recursive descent the algorithm is designed so as to match the structure of the
language and thus the structure of the input data that is being analyzed.
The main advantages of data structure design are:
_ there is high proximity between the structure of the program and the structure
the files. Hence a minor change to a file structure will lead only to a minor change
in the program
_ a series of well-defined steps leads from the specification to the design. Each
creates a well-defined product.
136 Chapter 10 _ Data structure design
10.1 Design a program to display a multiplication table such as young children use.
example, the table for numbers up to 6 is:
2 2 4 6 8 10 12
3 3 6 9 12 15 18
4 4 8 12 16 20 24

5 5 10 15 20 25 30
6 6 12 18 24 30 36
The program should produce a table of any size, specified by an integer input from
text box. (The structure of the input is irrelevant to this design.)
10.2 A data transmission from a remote computer consists of a series of messages.
message consists of:
1. a header, which is any number of SYN bytes
The basis of the data structure method is that the structure of a program can be
derived from the structure of the files that the program uses. The method uses a
notation for file and program structures. Using these diagrams, the method
proceeds step by step from descriptions of the file structures to a pseudo-code
The steps are:
1. draw a diagram (a data structure diagram) describing the structure of each of
the files that the program uses.
2. derive a single program structure diagram from the set of data structure
3. write down the elementary operations that the program will have to carry out.
4. associate the elementary operations with their appropriate positions in the
structure diagram
5. transform the program structure diagram into pseudo-code.
In some cases, a problem exhibits an incompatibility between the structures of
two of its inputs or outputs. This is known as a structure clash. The method
a scheme for dealing with structure clashes.