Technical Program
  Invited Speakers
  Technical Papers
  Practitioner Reports
Educators' Symposium
Doctoral Symposium
Student Research Comp.
Turing Lecture
Social Events
Week at a Glance
Final Program (1.5M .pdf)

Find in Program


view, help

Object-Oriented Programming, Systems, Languages and Applications
Home    Program    Housing & Transportation    Registration    Submissions    Wiki    Maps

 : Tuesday Demonstrations : All Demonstrations : Tuesday


Courtyard, Demo room 3
Tuesday, 15:30, 45 minutes


This event is also being given Thursday at 11:30.

Donald Gordon, Victoria University of Wellington
James Noble, Victoria University of Wellington
Robert Biddle, Carleton University

Demonstration number: 18

Keywords: encapsulation, message constraints, aliasing

Encapsulation is a fundamental principle of object-oriented programming. Support for encapsulation in many languages is limited to specifying access restrictions for fields; this does not guard against unrestricted aliasing, where due to programmer error, references to internal parts of aggregate objects can leak into other parts of the program, breaking encapsulation. Several systems have been proposed to deal with this problem. ConstrainedJava is a programming language with a syntax and semantics similar to those of Java (based on the BeanShell Java source interpreter), extended to maintain runtime ownership relationships between individual objects. Constraints on message sends between objects can then be imposed based on these ownership relationships. This enforces the encapsulation topology intended by the programmer, ensuring that references which leak from aggregate objects cannot cause unforseen dependencies, as message sends to these leaked references are disallowed. It also allows the programmer to explicitly define dependencies between objects, by providing notification of changes to objects and their children in the ownership tree.

The demonstration will include examples of message constraints, and the types of behaviour they inhibit. Also shown will be a demonstration of a GUI which utilises the explicit dependencies to simplify relating object state to widget state, and a demonstration of the natural cloning operation enabled by utilising ownership information to decide whether references or objects themselves should be copied.