Xd. Li et Gl. Zheng, INTRODUCING VIRTUAL INSTANCE VARIABLES IN CLASSES TO PROVIDE SUFFICIENT SUPPORT FOR ENCAPSULATION, ACM SIGPLAN NOTICES, 30(7), 1995, pp. 52-56
Encapsulation is a technique for minimizing interdependecies among sep
arately-writen modules by defining strict external interfaces. Many po
pular object-oriented languages (e.g, Smalltalk, Flavors, Objective-C
and Eiffel) allow free access to inherited instances variables by desc
endant classes, thus denying the designer the freedom to compatibly ch
ange the representation of a class without affecting clients and sever
ly compromising encapsulation. In this paper, by introducing virtual i
nstance variables and providing two interfaces (client-interface and s
ubclass-interface) for a class, we give a class mechanism which provid
es sufficent support for encapsulation and is implemented in NDOOM, a
object-oriented dialect of Modula-2 which we are developing.