We present an object-oriented calculus which allows arbitrary hiding of met
hods in prototypes, even in the presence of binary methods and friend funct
ions. This combination of features permits complete control of the interfac
e a class exposes to the remainder of a program (which is of key importance
for program readability, security and ease of maintenance), while still al
lowing complex interactions with other classes belonging to the same module
or software component.
This result is made possible by the use of views. A view is a name that spe
cifies an interface to an object. A set of views is attached to each object
and a method can be invoked either directly or via a view of the object.