> i use the identity map pattern [Fowler PoEAA] in my project, to
> store/cache many domain objects there. But what happen if the
[quoted text clipped - 6 lines]
> But do you have some ideas how to solve that on a client-side identity
> map?
Hmmm. That depends. If you access the database in such a way that the user
always has a consistent view of the data, you do not need to update the
objects, but you must resolve conflicts if the user updates/inserts/deletes
an object and its underlying representation.
Even if you notify users of changes in the underlying data, it is still
possible that they encounter a conflict if they perform a change due to a
race condition, so, conflict resolution is needed anyway.
Basically, what you do is fit the objects representing the data with methods
that check if the underlying data is still the same or still (non)existent
at the moment the user wants to propagate the changes in the object to the
database, and ask the user what to do if a conflict is raised. Or you can
adopt a scheme where 'last updater wins', for example.

Signature
Ruurd
.o.
..o
ooo
Steven Wolf - 07 Apr 2005 15:28 GMT
> Basically, what you do is fit the objects representing the data with methods
> that check if the underlying data is still the same or still (non)existent
> at the moment the user wants to propagate the changes in the object to the
> database, and ask the user what to do if a conflict is raised.
that sounds really good, something like
OnDirty()
{
mapper.findById ( this.id )
}
i thought also about, to realease cached objects after 5 minutes, so a
user retrieve updated data max. after 5 minutes.
but anyway, thats a real good simple solution..thanks!
R.F. Pels - 07 Apr 2005 20:28 GMT
> i thought also about, to realease cached objects after 5 minutes, so a
> user retrieve updated data max. after 5 minutes.
>
> but anyway, thats a real good simple solution..thanks!
You really should look into things like hibernate for example. A lot of
stuff is already done for you in that library. Quite powerfull.

Signature
Ruurd
.o.
..o
ooo
Steven Wolf - 08 Apr 2005 09:01 GMT
> > i thought also about, to realease cached objects after 5 minutes, so a
> > user retrieve updated data max. after 5 minutes.
[quoted text clipped - 3 lines]
> You really should look into things like hibernate for example. A lot of
> stuff is already done for you in that library. Quite powerfull.
thanks, i'll look into.