Department of Computer Science and Technology

Technical reports

Relationships for object-oriented programming languages

Alisdair Wren

November 2007, 153 pages

This technical report is based on a dissertation submitted March 2007 by the author for the degree of Doctor of Philosophy to the University of Cambridge, Sidney Sussex College.

DOI: 10.48456/tr-702

Abstract

Object-oriented approaches to software design and implementation have gained enormous popularity over the past two decades. However, whilst models of software systems routinely allow software engineers to express relationships between objects, object-oriented programming languages lack this ability. Instead, relationships must be encoded using complex reference structures. When the model cannot be expressed directly in code, it becomes more difficult for programmers to see a correspondence between design and implementation – the model no longer faithfully documents the code. As a result, programmer intuition is lost, and error becomes more likely, particularly during maintenance of an unfamiliar software system.

This thesis explores extensions to object-oriented languages so that relationships may be expressed with the same ease as objects. Two languages with relationships are specified: RelJ, which offers relationships in a class-based language based on Java, and QSigma, which is an object calculus with heap query.

In RelJ, relationship declarations exist at the same level as class declarations: relationships are named, they may have fields and methods, they may inherit from one another and their instances may be referenced just like objects. Moving into the object-based world, QSigma is based on the sigma-calculi of Abadi and Cardelli, extended with the ability to query the heap. Heap query allows objects to determine how they are referenced by other objects, such that single references are sufficient for establishing an inter-object relationship observable by all participants. Both RelJ and QSigma are equipped with a formal type system and semantics to ensure type safety in the presence of these extensions.

By giving formal models of relationships in both class- and object-based settings, we can obtain general principles for relationships in programming languages and, therefore, establish a correspondence between implementation and design.

Full text

PDF (1.2 MB)

BibTeX record

@TechReport{UCAM-CL-TR-702,
  author =	 {Wren, Alisdair},
  title = 	 {{Relationships for object-oriented programming languages}},
  year = 	 2007,
  month = 	 nov,
  url = 	 {https://www.cl.cam.ac.uk/techreports/UCAM-CL-TR-702.pdf},
  institution =  {University of Cambridge, Computer Laboratory},
  doi = 	 {10.48456/tr-702},
  number = 	 {UCAM-CL-TR-702}
}