[Mono-list] Mono.ADO.Net

Rodrigo Moya rodrigo@ximian.com
13 Dec 2001 02:02:48 +0100


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

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

* 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

* 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

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

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