Declarative Object Identity Using Relation Types

ECOOP'07: Proceedings of the 21st European conference on Object-Oriented Programming(2007)

引用 32|浏览68
暂无评分
摘要
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.
更多
查看译文
关键词
relation type,address-based object identifier,object identity,Featherweight Java,Java program,specified contract,stricter contract,programming model,Object-oriented language,error-prone boilerplate code,declarative object identity
AI 理解论文
溯源树
样例
生成溯源树,研究论文发展脉络
Chat Paper
正在生成论文摘要