Object identity is good when you want to know that the object is the exact same object.
- Caches, which may return invalid data when two instances of the same data are interchangeable.
- Related to above - multiple users editing the same information - normal equals methods will clobber one's information silently.
equals() is overrated except for value objects where there is a strict identity. I find I want objects to be equal in different ways in different circumstances.
Hence I am at least a little annoyed that Comparator is understood well, but there is no concept of an Equator. |