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.
- Head91.M. Headington, "Opaque types in C++," SCOOP-West 1991 Conference Proceedings, March 1991, pp. 17-23.Google Scholar
- Head94.M. Headington and D. Riley, Data Abstraction and Structures Using C++, D.C. Heath and Company, 1994. Google ScholarDigital Library
- Meye88.B. Meyer, Object-Oriented Software Construction, Prentice Hall, 1988. Google ScholarDigital Library
- Mica88.J. Micallef, "Encapsulation, reusability and extensibility in object-oriented programming languages," Journal of Object.Oriented Programming 1 (1), April/May 1988, pp. 12-38.Google Scholar
- Snyd86.A. Snyder, "Encapsulation and inheritance in object-oriented programming," OOPSLA '86 Conference Proceedings, September 1986, pp. 38-45. Google ScholarDigital Library
- Stro91.B. Stroustrup, The C++ Programming Lan. guage, 2nd Edition, Addison-Wesley, 1991. Google ScholarDigital Library
Index Terms
- Removing implementation details from C++ class declarations
Recommendations
Removing implementation details from C++ class declarations
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 ...
Comments