I am implementing a domain model for an application.  The objects in
the model should override the Object.Equal method (logical instead of
reference equality).  I have studied the "pattern" for implementing
equals and understand it.  What I am wrestling with is how much of the
objects state should be included in the comparison.

Two objects with the same ID are logically the same (in my
implementation).  However, I can conceive of having two variables
pointing to two instances of the same object.  If the state of one of
the instances changes (perhaps by changing one of the properties
values), should the two objects still be considered "logically" equal.

Essentially, is it sufficient to test the ID's of both object for
equality?  Or should I check every single mutable field as well?  What
are the ramifications to both implementations?  Will one
implementation work better/worse with other objects, such as
collections?

Todd
[EMAIL PROTECTED]

You can read messages from the Advanced DOTNET archive, unsubscribe from Advanced 
DOTNET, or
subscribe to other DevelopMentor lists at http://discuss.develop.com.

Reply via email to