In general, we can express abstract data using a collection of selectors and
constructors, together with some behavior conditions. As long as the behavior
conditions are met (such as the division property above), the selectors and
constructors constitute a valid representation of a kind of data. The
implementation details below an abstraction barrier may change, but if the
behavior does not, then the data abstraction remains valid, and any program
written using this data abstraction will remain correct.
If you want to change selection, open document below and click on "Move attachment"
2.2 Data Abstractionenom .
In addition, the appropriate relationship must hold among the constructor and
selectors. That is, if we construct a rational number x from integers n
and d , then it should be the case that numer(x)/denom(x) is equal to
n/d .
<span>In general, we can express abstract data using a collection of selectors and
constructors, together with some behavior conditions. As long as the behavior
conditions are met (such as the division property above), the selectors and
constructors constitute a valid representation of a kind of data. The
implementation details below an abstraction barrier may change, but if the
behavior does not, then the data abstraction remains valid, and any program
written using this data abstraction will remain correct.
This point of view can be applied broadly, including to the pair values
that we used to implement rational numbers. We never actually said much about
what a pair was, only that the la Summary
status | not read | | reprioritisations | |
---|
last reprioritisation on | | | suggested re-reading day | |
---|
started reading on | | | finished reading on | |
---|
Details