13.07.2015 Views

Software Design 2e - DIM

Software Design 2e - DIM

Software Design 2e - DIM

SHOW MORE
SHOW LESS

Create successful ePaper yourself

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

80<strong>Design</strong> qualitiesProcedures (methods)provide the means ofusing the stack, butconvey no detailsabout how it isorganized.push(x:integer);pop():integer);1010155integerstack‘Scope wall’ preventsany direct referencesbeing made to theelements in the datastructure that containsthe stack.Figure 4.5Example of information-hiding used with a module that provides an integer stack.to give controlled forms of access to the ‘clients’ of the module. The effect is to providea ‘scope wall’ around information, preventing direct access to it.As an example, this principle might be used in designing a module to provide aninteger stack facility to support a set of reverse Polish calculations using integers. Usingthe principle of information-hiding, one would seek to conceal the form adopted forimplementing the stack, and provide a set of procedures for accessing it, such as:push an integer onto the stackpop an integer from the stacktest for an empty stackas is shown schematically in Figure 4.5.This interface then conceals the detailed design decisions about how the stack is tobe implemented, which helps to ensure its integrity by preventing ‘short-cut’ accessdirectly from other program units. It also makes it possible to change the detailed formof implementation without requiring changes in any of the units that make use of thisstack.Powerful though the concept is, it is difficult to make use of it in any proceduralpractices for design, and equally difficult to devise a set of tests to identify its use. Interms of system quality factors it is clearly related to both reliability and maintainability.In terms of processor time and memory use, it is apt to conflict with ideas ofefficiency on occasion, since the use of a hierarchy of access procedures may lead toreduced run-time performance.The detailed forms in which these attributes manifest themselves in software systemsare somewhat elusive, although the concepts involved are generally quite tractable.A useful aid to considering the extent of their presence in a design is to examineit for signs of those features that indicate that a design may lack these qualities. Thisinvolves identifying a suitable set of features corresponding to attributes that are theinverse of those mentioned above. The presence of any of these features can beexpected to make it difficult to read and understand the designer’s intentions and tomake the resulting system difficult to modify.

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

Saved successfully!

Ooh no, something went wrong!