Ownership types for object encapsulation

  • Authors:
  • Chandrasekhar Boyapati;Barbara Liskov;Liuba Shrira

  • Affiliations:
  • Massachusetts Intitute of Technology, Cambridge, MA;Massachusetts Intitute of Technology, Cambridge, MA;Brandeis University, Waltham, MA

  • Venue:
  • POPL '03 Proceedings of the 30th ACM SIGPLAN-SIGACT symposium on Principles of programming languages
  • Year:
  • 2003

Quantified Score

Hi-index 0.00

Visualization

Abstract

Ownership types provide a statically enforceable way of specifying object encapsulation and enable local reasoning about program correctness in object-oriented languages. However, a type system that enforces strict object encapsulation is too constraining: it does not allow efficient implementation of important constructs like iterators. This paper argues that the right way to solve the problem is to allow objects of classes defined in the same module to have privileged access to each other's representations; we show how to do this for inner classes. This approach allows programmers to express constructs like iterators and yet supports local reasoning about the correctness of the classes, because a class and its inner classes together can be reasoned about as a module. The paper also sketches how we use our variant of ownership types to enable efficient software upgrades in persistent object stores.