A new notion of encapsulation

  • Authors:
  • David Gries;Jan Prins

  • Affiliations:
  • Computer Science Department, Corndl University;Computer Science Department, Corndl University

  • Venue:
  • SLIPE '85 Proceedings of the ACM SIGPLAN 85 symposium on Language issues in programming environments
  • Year:
  • 1985

Quantified Score

Hi-index 0.00

Visualization

Abstract

Generally speaking, a “module” is used as an “encapsulation mechanism” to tie together a set of declarations of variables and operations upon them. Although there is no standard way to instantiate or use a module, the general idea is that a module describes the implementation of all the values of a given type. We believe that this is too inflexible to provide enough control: one should be able to use different implementations (given by different modules) for variables (and values) of the same type. When incorporated properly into the notation, this finer grain of control allows one to program at a high level of abstraction and then to indicate how various pieces of the program should be implemented. It provides simple, effective access to earlier-written modules, so that they are useable in a more flexible manner than is possible in current notations. It generalizes to provide the ability to indicate structural transformations, in a disciplined fashion, in order to achieve efficiency with respect to time or space. However, the program will still be understood at the abstract level and the transformations or implementations will be looked at only to deal with efficiency concerns. Finally, some so-called “data types” (e.g. stack and subranges of the integers) can more properly be looked upon simply as restricted implementations of more general types (e.g. sequence and integer). Thus, the notion of subtype becomes less important.