Hello. Inline...

-----Original Message-----
From: Ben Kloosterman [mailto:[EMAIL PROTECTED]] 
Sent: Mittwoch, 9. Oktober 2002 12:26
To: [EMAIL PROTECTED]
Subject: Re: [ADVANCED-DOTNET] Strongly-Typed DataSets vs.
Strongly-Typed Collections


1. With DataSet you can do ordered updates as you can get allrecords
that were inserted , deleted etc . And pass these to the DB. In fact you
can do very complicated parent child updates easily . eg as an example
do all deletes , do child insert than updates and then do parent
inserts/ updates.

*** YES, thats exactly - where you run into problems having REALLY
complicated updates. Know it - been there :-) ALSO you have to code the
ORDER yourself. See the difference? YOU have to cal the table
insert/updates etc. YOURSELF. Our EntityBroker has a set set of objects
and mappings and generates this order HIMSELF. There is no need to
control the order of updates in your code at all. Now, how is this
inferior to a crude manual appraoch?

2. Delayed updates are also done with DataSets , except you set an
initial id value of a negative.  When updating a key ( to the correct
value for the insert ) the Dataset will update all references to the -ve
key. This also avoids nulls.

*** WRONG. Thats pretty SHITTY, because this means you get a changing
primary key. You can not take the PK out of the "object" and store it
until you have commited to the database. It also means that for every
update you have to ask for the value and have this return back. Thats
VASTLY inferior to have a number generator on the software (which, btw.,
you could also do with DataSets). Hate to tell you this, but this is NOT
cutting it.

*** Also, this is does NOT solve our problem with delayed updates and
backlinks that I was referring to.

*** See this, as a sample what I was meaning.
Table a -> b
Table b -> a (backlink)

Sort of: a is customer, b are his bank accounts, every bank account (or
credit card or shipping address) has a link to it's customer, the
customer has a backlink back to the "default or dcrrent" value.

Problem: You can NOT insert this into the database in one pass - SQL
Server at least does NOT support delayed integrity checkingm, like some
other databases. You can not insert b, as the link to a needs to
resolve, and you can not insert a, as the link to b needs to resolve.

Solution: Insert b, with NULL in place of the link, insert A, then
update B for the value.

EntityBroker: Automatic (link is marked with "Backlink=true")
DataSet: By hand.

Now, this might sound like a not too common problem - it is pretty
common when you orient your DB design around your dataaset.
<---

I think it is more a case  that people are not very familiar with the
DataSets and how to use it. Datasets give good performance and are
flexible , and rich in features. They do take to much memory though
which means intermachine performance can suffer unless they are
compressed.

*** Datasets give a mediocre performance and are terrible to use in
larger, distributed applications. Memory consumption is really bad -
which can be a problem to build a cache of objects in memory, which is
the KEY to BOOST your performance in some scenarios by sometimes more
than 1000%. Again, here: EntityBroker (O/R mapper approach):
semiautomatic (possible controlled by attributes). DataSet: By hand. You
losse.

Thomas Tomiczek
THONA Consulting Ltd.
(Microsoft MVP C#/.NET)

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