Generated hashCode() implementations of ValueObjects
look quite nice but they are suboptimal in respect to
Instead of naive multiplying with prime number, you
should rather XOR the hashCode-values of the
ValueObjects' chield attributes. Assuming that these
hashCodes are already implemented to scatter fairly,
XOR will provide best scattering of merged results.
Furthermore, bit-wise XOR is a cheaper operation that
Log in to post a comment.