Dale - Computer Science Illuminated 204

Dale - Computer Science Illuminated 204 - computer language...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
Information hiding The practice of hiding the details of a module with the goal of controlling access to the details of the module Abstraction A model of a complex system that includes only the details essential to the viewer 6.4 Important Threads 177 design. This practice, called information hiding , makes the details at a lower level inaccessible during the design of the higher levels. This practice must seem very strange! Why shouldn’t the details be accessible while the algorithm is being designed? Shouldn’t the designer know everything? No. If the designer knows the low-level details of a module, he/she is more likely to base the module’s algorithm on these details. And it is these low-level details that are more likely to change. If they do, then the entire module has to be rewritten. The advantage of using information hiding when writing algorithms becomes more evident when we look at translating the algorithm into a
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: computer language, so we return to this thread later. Abstraction Abstraction and information hiding are two sides of the same coin. Infor-mation hiding is the practice of hiding details; abstraction is the result with the details hidden. As we said in Chapter 1, an abstraction is a model of a complex system that includes only the details essential to the viewer. Take, for example, Daisy, the English Spaniel. To her owner she is the household pet, to a hunter she is a bird dog, and to the vet she is a mammal. Her owner sees her wagging tail, hears her yelp when she gets left outside, and see the hair she leaves everywhere. The hunter sees a finely trained helper who knows her job and does it well. The vet sees all of the organs, flesh, and bones of which she is composed. See Figure 6.9. Figure 6.9 Different views of the same concept...
View Full Document

{[ snackBarMessage ]}

Ask a homework question - tutors are online