The Source for Java Technology Collaboration
User: Password:



Start New Message Delete Post a Reply

Article: 
 You Are What You Is: Defining Object Identity
Subject:  i'm really having a hard time...
Date:  2006-08-01 17:04:36
From:  shammah
Response to: i'm really having a hard time...


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.

 Feed java.net RSS Feeds