[Mono-list] Mono.ADO.Net

Adam Chester a.chester@sph.uq.edu.au
Thu, 13 Dec 2001 18:11:02 +1000


RE DataSet's:

"That is, I can't imagine why somebody will get a picture of an
entire database, modify it for a day, for instance, and then put it back
to the database"

Actually, this is kind of core the whole ADO.NET model (the disconnected
DataSet's). The theory is you get the data as quickly as possible and then
you are disconnected from the database server to avoid using (and locking)
server resources.

Then once you complete your modifications (which are stored in the DataSet
as being modified) it compiles a list of changes and calls the respective
Update/Insert/Delete commands using the DBDataAdapter.

It's not necessarily a "nightmare" as you put it, because you can easily
implement concurency techniques to avoid modifying any data that was changed
after you aquired your DataSet snapshot.

- Adam


-----Original Message-----
From: mono-list-admin@ximian.com [mailto:mono-list-admin@ximian.com]On
Behalf Of Rodrigo Moya
Sent: Thursday, December 13, 2001 11:03 AM
To: Miguel de Icaza
Cc: mono-list@ximian.com
Subject: [Mono-list] Mono.ADO.Net


Hi!

Ok, so as suggested by Miguel, I went through a chapter about ADO.Net in
a book I've got, and read about it, to see if the implementation of the
ADO.Net classes can be developed in Mono using libgda/gnome-db
(www.gnome-db.org)

I must confess that I haven't read too deep that chapter, so I'd
appreciate if somebody with a good knowledge on ADO.Net can correct
me/add new things to what I say.

Ok, so, the short answer is that libgda/gnome-db can be perfectly be
used in Mono.ADO.Net. I've found a lot of similar stuff, and the missing
pieces in libgda/gnome-db can be (or even some are being) developed
easily:

* basic ADO.Net interfaces map easily to libgda ones:
	- IDbConnection -> GdaConnection
	- IDbCommand -> GdaCommand
	- IDbDataReader -> GdaDataModel
	- IDbDataAdapter -> GdaServerProvider

* DataSet's: there's no such thing in libgda, but adding this is just a
matter of creating a new GObject class to libgda, since all the needed
stuff (XML for data transfer, offline, etc) is already available in
libgda or can easily be implemented.
The only thing I think won't be easy to implement is read-write
datasets. That is, I can't imagine why somebody will get a picture of an
entire database, modify it for a day, for instance, and then put it back
to the database. This can be a nightmare if the database has been
modified by other people. But, well, it's not something impossible to
implement, so if it's needed, it can be added.

* DataColumn, Constraint, DataView, DataRow, etc, all these have their
counterparts in libgda. Some work might be done to add the level of
detail all these classes seem to have in ADO.Net, but, again, nothing
difficult to do.

* XML: we are using custom XML formats for representing SQL queries (XML
queries we call them) and an entire database (GdaXmlDatabase), so maybe
there can be a problem with this custom format if it is to be shared
with other apps.
We were thinking on switching to the XML DTDs defined in
http://www.odmg.org. Maybe we should support various formats for all
this?

* GUI -> in gnome-db, we've got a bunch of data-bound widgets (grids,
lists, icon lists, labels, entries, etc), and all of them use a
GdaDataModel, which is an abstract class for getting data from
somewhere. This is the way I've seen the ADO.Net's DataGrid works

* IDbAdapter -> I guess we should just provide a System.Data.MonoDB (or
GnomeDB, or whatever) managed provider (as there is OleDb and SqlClient
in ADO.Net), or replace the 2 in ADO.Net with the GNOME-DB one. BTW,
this interface maps almost exactly (from what I've seen) to the libgda
API.

One thing to note about libgda/gnome-db usage in Mono is that
libgda/gnome-db are being refactored for GNOME 2, cleaning up a lot of
things and adding more-easily-extended interfaces, so anything that is
needed for Mono.ADO.Net can be added to libgda/gnome-db if it makes
sense.

cheers
--
Rodrigo Moya <rodrigo@gnome-db.org> - <rodrigo@ximian.com>
http://www.gnome-db.org/ - http://www.ximian.com/


_______________________________________________
Mono-list maillist  -  Mono-list@ximian.com
http://lists.ximian.com/mailman/listinfo/mono-list