On 21/10/2009, at 12:55 AM, David James wrote:
> I wouldn't go there. Hashes (a sufficiently complicated example) know
> how to compare against other hashes based on their
> contents. MongoMapper should too.
If only it were that simple. Anything and everything can throw it off,
and once you say you can do it, you better do it right. I'd rather
just disclaim responsibility for the whole thing.
I just think this is one of these things which sounds simple but
isn't. I mean a few mails ago you were arguing against including _id
in a comparison; I would be dead against that. Timestamps are another
obvious point of controversy; if you're not checking _id then you
certainly wouldn't check timestamps and yet in my opinion they are
absolutely part of the data. Then there's time objects themselves,
always a nightmare. What about the question of do you compare
existence of keys, nils vs the key not being there in the first place,
hell, is it an ordered hash or an unordered hash. What if people have
callbacks. How about default values, should they be compared. What
about meta-data; dirty, new, etc, should that be compared.
Etc etc ....
I understand where you are coming from. I just think it is a giant
pain to implement, difficult to reach consensus on how it should work,
and in the end, there's only one person who knows what is the salient
data to be compared, and that is the application level developer.
That said I am actually completely ambivalent about this behaviour in
MM, I just thought it was an interesting topic. So I think I should
shut up and let you make your case,sorry .. : )
> >