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.

114Transferring design knowledge6.2.3 Examples of some software architectural stylesOne qualification that does need to be made right at the outset (and which is firmlymade in Shaw and Clements (1997) is that real systems are not necessarily ‘pure’ interms of their architectural style, and so may possess the characteristics of more thanone style. (This is not inconsistent with what we see in other domains. Buildings maywell be altered and extended with the passage of time, and the changes may not necessarilybe consistent with the original style – which should not be taken to imply thatthere is necessarily a mismatch.) As with buildings, the presence of ‘hybrids’ does notrender the basic idea of classification any less useful.The descriptions provided in the rest of this section are of necessity brief ones, andfor fuller discussion of these issues the reader should consult a specialized source suchas Shaw and Garlan (1996) or Shaw and Clements (1997). To illustrate the conceptsinvolved, we will look at three examples of widely encountered architectural styles.1. Pipe and filterThis style (which from the 1970s onwards has been embodied within the architectureof the Unix operating system) is essentially one based upon the transformations thatare centred around the dataflow that occurs within some form of network. Indeed,although the Unix variant is essentially linear, many non-linear topological formsexist, such as the MASCOT approach described in Simpson and Jackson (1979).Examples of these are shown in Figures 6.1 and 6.2.In a pipe and filter architectural style, the components are typically processes thattransform an input data stream into an output stream (the ‘filters’), connected togetherby some form of dataflow mechanism, which may occur in a synchronous or asynchronousmanner. A widely-cited example is the ‘classical’ approach to compiler design,in which a series of operations are performed to gradually transform the source code intosome form of binary code. Each element, such as a lexer or parser, acts as a filter, transforminga stream of input tokens into the form required by the next stage. For example,the lexer inputs a stream of characters and splits this into the ‘lexemes’ or groupsof characters that have meaning in the context of the program. So the input expressioncount = count + 1;FilesFilterInput datastream1sPipegrepprFigure 6.1List the filesin the directoryin sorted orderThe pipe-and-filter style: Unix processes.‘Select’ thosethat meet therequired patternPrint out theselected filesin suitable format

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

Saved successfully!

Ooh no, something went wrong!