Declarative object identity using relation types

25Citations
Citations of this article
23Readers
Mendeley users who have this article in their library.
Get full text

Abstract

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. © Springer-Verlag Berlin Heidelberg 2007.

Cite

CITATION STYLE

APA

Vaziri, M., Tip, F., Fink, S., & Dolby, J. (2007). Declarative object identity using relation types. In Lecture Notes in Computer Science (including subseries Lecture Notes in Artificial Intelligence and Lecture Notes in Bioinformatics) (Vol. 4609 LNCS, pp. 54–78). Springer Verlag. https://doi.org/10.1007/978-3-540-73589-2_4

Register to see more suggestions

Mendeley helps you to discover research relevant for your work.

Already have an account?

Save time finding and organizing research with Mendeley

Sign up for free