Sciweavers

ICSE
2009
IEEE-ACM

Equality and hashing for (almost) free: Generating implementations from abstraction functions

15 years 1 months ago
Equality and hashing for (almost) free: Generating implementations from abstraction functions
ng Implementations from Abstraction Functions Derek Rayside, Zev Benjamin, Rishabh Singh, Joseph P. Near, Aleksandar Milicevic and Daniel Jackson Computer Science and Artificial Intelligence Laboratory Massachusetts Institute of Technology {drayside, zev, rishabh, jnear, aleks, dnj}@csail.mit.edu In an object-oriented language such as Java, every class requires implementations of two special methods, one for determining equality and one for computing hash codes. Although the specification of these methods is usually straightforward, they can be hard to code (due to subclassing, delegation, cyclic references, and other factors) and often harbor subtle faults. A technique is presented that simplifies this task. Instead of writing code for the methods, the programmer gives, as a brief annotation, an abstraction function that defines an abstract view of an object's representation, and sometimes an additional observer in the form of an iterator method. Equality and hash codes are then...
Derek Rayside, Zev Benjamin, Rishabh Singh, Joseph
Added 17 Nov 2009
Updated 17 Nov 2009
Type Conference
Year 2009
Where ICSE
Authors Derek Rayside, Zev Benjamin, Rishabh Singh, Joseph P. Near, Aleksandar Milicevic, Daniel Jackson
Comments (0)