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.

Full Text
Published version (Free)

Talk to us

Join us for a 30 min session where you can share your feedback and ask us any queries you have

Schedule a call