Sciweavers

ECOOP
2007
Springer

Declarative Object Identity Using Relation Types

13 years 11 months ago
Declarative Object Identity Using Relation Types
Object-oriented languages define the identity of an object to be an address-based object identifier. The programmer may customize the notion of object identity by overriding the equals() and hashCode() methods following a specified contract. This customization often introduces latent errors, since the contract is unenforced and at times impossible to satisfy, and its implementation requires tedious and error-prone boilerplate code. Relation types are a programming model in which object identity is defined declaratively, obviating the need for equals() and hashCode() methods. This entails a stricter contract: identity never changes during an execution. We formalize the model as an adaptation of Featherweight Java, and implement it by extending Java with relation types. Experiments on a set of Java programs show that the majority of classes that override equals() can be refactored into relation types, and that most of the remainder are buggy or fragile.
Mandana Vaziri, Frank Tip, Stephen Fink, Julian Do
Added 07 Jun 2010
Updated 07 Jun 2010
Type Conference
Year 2007
Where ECOOP
Authors Mandana Vaziri, Frank Tip, Stephen Fink, Julian Dolby
Comments (0)