Deviation from object-relational mapping (pySQLFace)

Paul Boddie paul at boddie.org.uk
Tue Oct 14 07:26:46 EDT 2008


On 14 Okt, 00:43, sulyokp... at gmail.com wrote:
>
> It is not convincing to look at an XML file alone. Let me give you an
> example. Glade is a GTK+ application for creating GTK+ GUI. It
> generates an XML file, that can be loaded in every programming
> language that has libglade binding. Similarly, there could be a
> database design tool to create a database, and save SQL/DML
> expressions into an XML config file. Then you create the RDB command
> objects by loading the XML in your favourite language.

I'd agree that XML makes a good interchange representation which saves
everyone from having to parse various things, but having worked a bit
with relational databases and having had to actively manage their
schemas, I have to say that my primary representation for a schema is
SQL/DDL, and that my primary representation for queries is also SQL.
Now, there's a lot to be said for making that SQL more consumable, and
I've done a little work on converting SQL to XML (as have many others)
in order to make life easier for, say, tool authors, and I'd even go
as far as saying that it should be possible to convert XML back to
SQL, but in doing so there would potentially remain a need for the XML
dialect to be as expressive as SQL, which then means that you have to
replicate SQL in XML.

> I think programming languages are intended for describing neither relational
> databases nor GUIs.

The above discussion is somewhat tangential to what you've done,
though, and I certainly didn't mean to say that the use of XML was in
any way "wrong", especially in the way you've been using it. I suppose
that when you state the above about programming languages, you
actually mean languages other than SQL. Even so, I'd much rather use
SQL to describe a database table than one of the many different Python-
based, class-plus-attributes representations so beloved of the various
object-relational mappers.

I look forward to seeing where you take your project in future,
however.

Paul



More information about the Python-list mailing list