Removing implementation details from C++ class declarations

  • Authors:
  • Mark R. Headington

  • Affiliations:
  • Computer Science Department, University of Wisconsin-La Crosse, La Crosse, WI

  • Venue:
  • SIGCSE '95 Proceedings of the twenty-sixth SIGCSE technical symposium on Computer science education
  • Year:
  • 1995

Quantified Score

Hi-index 0.00

Visualization

Abstract

Data abstraction—a concept introduced at varying places in the CS1/CS2/CS7 sequence—separates the properties of a data type (its values and operations) from the implementation of that type. This separation of specification from implementation is achieved by encapsulating the implementation so that users of the type can neither access nor be influenced by the implementation details. Ideally, therefore, the specification should be implementation-independent.The C++ class mechanism compromises information hiding by requiring the interface to include information—the private part of the class declaration—that is needed only for implementation purposes. This paper describes two techniques for removing details of implementation structure from the C++ class declaration and discusses the advantages and disadvantages of each.