views:

35

answers:

1

In a recent discussion on ORMs for webapps someone mentioned that there are times you don't want to have IdentityMaps for webapps. I don't understand this, because it seems as though in the context of a singular request to the app, you would want all work on records to be consistent. This means if I "look" at an object A which references B, and later I look at B via another object C that happens to reference B as well, I can't think of a time when I wouldn't want this to be the same B.

When would you want A.B and C.B or even a direct look up of B to not return a reference to the same in-memory object?

A: 

Perhaps in some kind of load-balance scenario app1_b != app2_b by reference however from a an object content perspective app1_b.Equals(app2_b) == true. Just a thought. (This is just pseudocode to describe it.) This assumes there is some kind of information shared between apps at some layer of course in order to facilitate a change in a regular identity map.

John K
yeah, but in that case if you care about object equality you've got a larger synchronization issue. So I'm guessing other than inter-app communication nobody really sees a place were an identity map for objects doesn't make sense?