Introducing virtual instance variables in classes to provide sufficient support for encapsulation

  • Authors:
  • Li XueDong;Zheng Guoliang

  • Affiliations:
  • Department of Computer Science, Nanjing University, Nanjing, Jiangsu, P.R. China;Department of Computer Science, Nanjing University, Nanjing, Jiangsu, P.R. China

  • Venue:
  • ACM SIGPLAN Notices
  • Year:
  • 1995

Quantified Score

Hi-index 0.00

Visualization

Abstract

Encapsulation is a technique for minimizing interdependecies among separately-writen modules by defining strict external interfaces. Many popular object-oriented languages (e.g, Smalltalk, Flavors, Objective-C and Eiffel) allow free access to inherited instances variables by descendant classes, thus denying the designer the freedom to compatibly change the represnntation of a class without affecting clients and severly compromising encapsulation. In this paper, by introducing virtual instance variables and providing two interfaces (client-interface and subclass-interface) for a class, we give a class mechanism which provides sufficent support for encapsulation and is implemented in NDOOM, a object-oriented dialect of Modula-2 which we are developing.