Abstract:
|
We present in this paper a proposal for developing efficient programs in
the abstract data type (ADT) programming framework, keeping the modular
structure of programs and without violating the information hiding
principle. The proposal focuses in the concept of "shortcut" as an
efficient way of accessing to data, alternative to the access by means
of the primitive operations of the ADT. We develop our approach in a
particular ADT, a store of items. We define shortcuts in a formal
manner, using algebraic specifications interpreted with initial
semantics, and so the result has a well-defined meaning and fits in the
ADT framework. Efficiency is assured with an adequate representation of
the type, which provides O(1) access to items in the store without
penalising the primitive operations of the ADT. |