In general, the underlying idea of data abstraction is
to identify a basic set of operations in terms of which all manipulations of
values of some kind will be expressed, and then to use only those operations in
manipulating the data. By restricting the use of operations in this way, it is
much easier to change the representation of abstract data without changing the
behavior of a program.
If you want to change selection, open document below and click on "Move attachment"
2.2 Data Abstractionefore continuing with more examples of compound data and data abstraction, let
us consider some of the issues raised by the rational number example. We
defined operations in terms of a constructor rational and selectors
numer and denom . <span>In general, the underlying idea of data abstraction is
to identify a basic set of operations in terms of which all manipulations of
values of some kind will be expressed, and then to use only those operations in
manipulating the data. By restricting the use of operations in this way, it is
much easier to change the representation of abstract data without changing the
behavior of a program.
For rational numbers, different parts of the program manipulate rational
numbers using different operations, as described in this table.
Parts of the program that... Treat rationals Summary
status | not read | | reprioritisations | |
---|
last reprioritisation on | | | suggested re-reading day | |
---|
started reading on | | | finished reading on | |
---|
Details