next up previous
Next: Inheritance Up: The Design Process Previous: Encapsulation

Modularity and Information Hiding

One principle of design is called information hiding. Years of programming experience has shown that programmers have a tendency to take advantage of what the they know about the internals of the system. This might be fine if nothing ever changed. But the reality is that software is constantly changing. Therefore, we do not want to expose ourselves to having others think they know how something is done. We want others to use exactly those features that we all agree are immutable without some formal agreement. The term module has come to mean a collection of data and routines that also provides for some form of security. Data or routines available to anyone (inside or) outside the module is classified as public. Data and routines that are available to only those inside the module are called private. Public data and routines are often said to be exported. Collectively, all these concepts are termed information hiding. This disciplined way of doing things has several advantages:

  1. Performance can be enhanced by maintaining public interfaces but redoing private data and routines.
  2. Access to very complex operations or data can be controlled in a way that only a few people need to understand all the messy details.
  3. Reliability is enhanced as one can build a firewall as discussed in section 8.4.
  4. Details that are likely to change can be protected. Some of the areas that are likely to change are

    tabular157

Some criteria for quality in module design are shown in Figure 5. These criteria are in addition to those related to coupling and cohesion.

   table163
Table 5: Module Quality



Steve Stevenson
Wed Feb 26 10:54:45 EST 1997