Re: Finally which ORM tool?
- From: Jon Skeet [C# MVP] <skeet@xxxxxxxxx>
- Date: Thu, 11 Oct 2007 18:19:24 +0100
James Crosswell <james@xxxxxxxxxxxxxx> wrote:
Without any context/session idea, you can't do that. It's unimportant
in some scenarios, and vital in others.
Hm, I'm still not sure I see the significance of this. Essentially
you're saying you want to keep only one instance of a particular object
in memory (anywhere in memory) at any one time (one object per row)??? I
can't think of any reason to require such a thing.
Suppose I fetch (within the context of a web request, for instance)
some suppliers and some customers. These both have addresses which are
stored in another table.
Now, what happens if a supplier and a customer both have the same
address, represented by the same row in the database? If I change the
details of the address of the supplier, it *should* change the details
of the address of the customer, because they're the same entity. If you
have identity management, you can make sure this happens - if you've
created two separate objects for the same address, you could change
each object independently, then issue updates to the database thinking
everything is okay when it's not.
In a nutshell, identity management allows the loaded entities to more
closely reflect the actual situation in the database.
(Within different sessions, you'd want different objects so they can
have different lifetimes etc - an update in two sessions may well cause
a concurrency violation, but that should be expected and catered for.)
--
Jon Skeet - <skeet@xxxxxxxxx>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too
.
- Follow-Ups:
- Re: Finally which ORM tool?
- From: James Crosswell
- Re: Finally which ORM tool?
- References:
- Finally which ORM tool?
- From: AliRezaGoogle
- Re: Finally which ORM tool?
- From: James Crosswell
- Re: Finally which ORM tool?
- From: Frans Bouma [C# MVP]
- Re: Finally which ORM tool?
- From: Jon Skeet [C# MVP]
- Re: Finally which ORM tool?
- From: James Crosswell
- Re: Finally which ORM tool?
- From: Jon Skeet [C# MVP]
- Re: Finally which ORM tool?
- From: James Crosswell
- Finally which ORM tool?
- Prev by Date: Re: Translating WinForm menu items dynamically
- Next by Date: Re: Unidentified Publisher etc. Message
- Previous by thread: Re: Finally which ORM tool?
- Next by thread: Re: Finally which ORM tool?
- Index(es):
Relevant Pages
|
Loading