13.07.2015 Views

Software Design 2e - DIM

Software Design 2e - DIM

Software Design 2e - DIM

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

307Figure 14.16The finance department’s file.Some JSP heuristicsFigure 14.17The personnel department’s file.it isn’t clear that Sam will be equally pleased with the size of his cheque, and so thereobviously is a need to perform some form of remedial action.This is an example of what Jackson terms a ‘structure clash’. This particular formis an ‘ordering clash’, and occurs when one or more of the input streams are orderedusing different keys. In the case of our example, the keys involved are the staff identitynumber and the name.As it happens, this type of structure clash can often be resolved fairly easily, providedthat the two files contain a common key. In this example, since both of the inputfiles share a common key in the form of the identity number, the personnel data file cansimply be reordered around this key by using an intermediate sorting program (anadditional filter process), so that the file corresponds to the ordering used in the financedata file. Following this reasonably simple operation, the Lotsalogs employees canlook forward to receiving their correct Christmas and New Year pay.The other two types of structure clash that Jackson identifies are the boundaryclash, in which data is broken up using different criteria, although ordered by the samekeys; and the multithreading clash, in which data elements overlap in the input file.The idea of a boundary clash can be clarified by considering the two views that can betaken when describing the structure of a text file stored on a disk. At the programminglevel, it is considered to consist of a sequence of variable-length records, made up ofstrings of characters. However, to the low-level software of the operating system, thefile is organized as a sequence of disk blocks of standard size. Figure 14.18 shows theStructure Diagrams that represent these two quite different views of the same file – onerecord-based, the other block-based. It is the task of the file-handling routines of theoperating system to resolve these and to transform between them as necessary.Structure clashes essentially arise because of some implicit assumptions that aremade within the forms used in JSP. They are based on inconsistencies that arise in theordering of components when these are viewed at a lower level of abstraction than isprovided by the Structure Diagram. To handle these clashes without continual recourseto extra sorting and merging routines, JSP has developed an associated technique

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

Saved successfully!

Ooh no, something went wrong!