21.08.2013 Views

Software Engineering for Students A Programming Approach

Software Engineering for Students A Programming Approach

Software Engineering for Students A Programming Approach

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

10.6 Discussion 135<br />

■ teachable – people can be taught the method because it consists of well-defined steps<br />

■ consistent – given a single program specification, two different people will come up<br />

with the same program design.<br />

■ simple and easy to use<br />

■ produces designs that can be implemented in any programming language.<br />

While these characteristics can be regarded as advantages, they can also be seen as a<br />

challenge to the traditional skills associated with programming. It is also highly contentious<br />

to say that data structure design is completely non-inspirational and rational.<br />

In particular, some of the steps arguably require a good deal of insight and creativity,<br />

<strong>for</strong> example, drawing the data structure diagram, identifying the elementary operations<br />

and placing the operations on the program structure diagram.<br />

Applicability<br />

Data structure design is most applicable in applications where the structure of the<br />

(input or output) data is very evident. Where there is no clear structure, the method<br />

falls down.<br />

For example, we can assess how useful this method is <strong>for</strong> designing computational<br />

programs by considering an example. If we think about a program to calculate the<br />

square root of a number, then the input has a very simple structure, and so has the output.<br />

They are both merely single numbers. There is very little in<strong>for</strong>mation upon which<br />

to base a program structure and no guidance <strong>for</strong> devising some iterative algorithm that<br />

calculates successively better and better approximations to the solution. Thus it is<br />

unlikely that data structure design can be used to solve problems of this type.<br />

The role of data structure design<br />

Data structure design’s strong application area is serial file processing. Serial files are widely<br />

used. For example, graphics files (e.g. JPEG and GIF <strong>for</strong>mats), sound files (e.g. MIDI),<br />

files sent to printers (e.g. PostScript <strong>for</strong>mat), Web pages using HTML, spreadsheet files<br />

and word processor files. Gunter Born’s book (see Further Reading) lists hundreds of<br />

(serial) file types that need the programmer’s attention. So, <strong>for</strong> example, if you needed to<br />

write a program to convert a file in Microsoft <strong>for</strong>mat to an Apple Macintosh <strong>for</strong>mat, data<br />

structure design would probably be of help. But perhaps the ultimate tribute to the<br />

method is the use of an approach used in compiler writing called recursive descent. In<br />

recursive descent the algorithm is designed so as to match the structure of the programming<br />

language and thus the structure of the input data that is being analyzed.<br />

The main advantages of data structure design are:<br />

■ there is high “proximity” between the structure of the program and the structure of<br />

the files. Hence a minor change to a file structure will lead only to a minor change<br />

in the program<br />

■ a series of well-defined steps leads from the specification to the design. Each stage<br />

creates a well-defined product.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!