Sciweavers

TOOLS
2010
IEEE

Understanding the Impact of Collection Contracts on Design

13 years 10 months ago
Understanding the Impact of Collection Contracts on Design
Abstract. Java provides a specification for a user-defined general purpose equivalence operator for objects, but collections such as Set have more stringent requirements. This inconsistency breaks polymorphism: programmers must take care to follow Set’s contract rather than the more general Object contract if their object could enter a Set. We have dynamically profiled 30 Java applications to better understand the way programmers design their objects, to determine whether they program with collections in mind. Our results indicate that objects which enter collections behave very differently to objects which do not. Our findings should help developers understand the impact of design choices they make, and guide future language designers when adding support for collections and/or equality.
Stephen Nelson, David J. Pearce, James Noble
Added 31 Jan 2011
Updated 31 Jan 2011
Type Journal
Year 2010
Where TOOLS
Authors Stephen Nelson, David J. Pearce, James Noble
Comments (0)