Joe Darcy: API Design: Identity and Equality
Joseph Darcy considers API Design: Identity and Equality :
When designing types to be reused by others, there are
title="API Design: Interfaces versus Abstract Classes">reasons to favor interfaces over abstract classes . One complication of using an interface-based approach stems from defining reasonable behavior for the
hashCode methods, especially if different implementations are intended to play well together when used in data structures like collections , in particular if an interface type is meant to serve as the key of a map or as the element type of a set ...