How is DataSet class implemented

B

Boaz Ben-Porat

I heard somewhere that the DataGrid class is implemented as a XML graph in
memory. Is this true ?

TIA
Boaz Ben-Porat
DataPharm a/s
Denmark
 
J

Jeffrey Tan[MSFT]

Hi Boaz,

The dataset class can be easily display as a xml graph, you can just
display it like this:
Console.WriteLine( ds.GetXml() );
Also, dataset can manipulate the xml file freely by writexml method

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

--------------------
| From: "Boaz Ben-Porat" <[email protected]>
| Subject: How is DataSet class implemented
| Date: Wed, 1 Oct 2003 17:19:16 +0200
| Lines: 9
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2800.1106
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106
| Message-ID: <[email protected]>
| Newsgroups: microsoft.public.dotnet.languages.csharp
| NNTP-Posting-Host: 195.215.64.74
| Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP11.phx.gbl
| Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.languages.csharp:188393
| X-Tomcat-NG: microsoft.public.dotnet.languages.csharp
|
| I heard somewhere that the DataGrid class is implemented as a XML graph in
| memory. Is this true ?
|
| TIA
| Boaz Ben-Porat
| DataPharm a/s
| Denmark
|
|
|
 
B

Boaz Ben-Porat

Thanks Jeffry

My question is:
Is Reading and manipulating data in DataSet more effective or less effective
then reading and mnipulating in custom developed objects. If DataSet IS
implemented as one large XML document in RAM then I suspect it is NOT the
most effective structure. Am I right ?

TIA
Boaz Ben-Porat
DataPharm a/s
Denmark
 
B

Boaz Ben-Porat

What I heard is that DataSet is ACTUALLY implemented as a XML graph in
RAM, and thus ineffective when used to other operations then direct data
manipulation.

We are at the design phase of a very large system, to be implemented in
C#/.NET. We should generate (automatically) a datatype for each
table/view/stored-procedure(proc`s result set). The easiest way is to
generate a typed DataSet for each object (This can be done with 10 line
of code.

Anotehr soloution is to write a code generator that creates a C# class
for each such object. My company has experince with this.

These objects, either custom objects or Typed DataSet (where DataRow is
the base object) are used for wide range of manipulations.

The Question:
-------------
Is DataSet effective in such scenario ?
If it is an XML graph in RAM then I suspect it is NOT effective.

Any advise ?

TIA
Boaz Ben-orat
DataPharm a/s
Denmark
 
I

Ignacio Machin \( .NET/ C# MVP \)

Hi Boaz,

I don't think so, that the dataset can be represented as a XML document has
nothing to do with its internal way to keep the data once it's readed from a
XML file. You can take a look at the .net source ( I don't remember where
you can get them, I will let you know if I remember) and see how the DataSet
is implemented.


Cheers,
 
M

Michael Culley

Does it matter how it is implemented? Test both methods and compare the difference, if the dataset does use xml underneath but is
somehow more efficient then it doesn't really matter.
 
J

Jay B. Harlow [MVP - Outlook]

Boaz,
As Ignacio stated, the DataSet is not implemented internally as one large
XML document.

It is implemented as a collection of DataTable objects, DataTables are
implemented as a collection of DataColumn & DataRow objects. DataRow objects
are implemented as an array of System.Object objects.

Remember when you put value types into a Sytem.Object you need to box &
unbox them, so there is a performance hit there. Also the fact the DataRow
has an array of them, there is a second hit.

If by "custom developed objects" you mean a formal domain model, I would
expect the formal domain model to be more performant as it should be doing
less boxing & unboxing and have fewer collections.

David Sceppa's book "Microsoft ADO.NET - Core Reference" from MS Press
covers all aspects of DataSets and how they are organized.

Martin Fowlers book "Patterns of Enterprise Application Architecture" from
Addison Wesley provides a number of patterns for getting data from a
database to & from your domain model & patterns on using DataSets verses
domain models.

Rockford Lhotka's book "Expert One-on-One Visual Basic .NET Business
Objects" from APress (formally from Wrox) provides the CSLA.NET framework
which gives you the flexibility of a DataSet while defining a formal Domain
Model.

Hope this helps
Jay
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top