Sharing Objects by Read-Only References

  • Authors:
  • Mats Skoglund

  • Affiliations:
  • -

  • Venue:
  • AMAST '02 Proceedings of the 9th International Conference on Algebraic Methodology and Software Technology
  • Year:
  • 2002

Quantified Score

Hi-index 0.00

Visualization

Abstract

Exporting objects by reference can be problematic since the receivers can use the received reference to perform state changing operations on the referenced object. This can lead to errors if the referenced object is a subobject of a compound object not anticipating the change. We propose an extension of a type system with a read-only construct that can be used to control access to state changing methods. We formulate and prove a read-only theorem for read-only references stating that a read-only reference cannot be used to perform operations that change its referenced object state.