object-relational mappers

Paul Boddie paul at boddie.org.uk
Thu Apr 3 09:00:14 EDT 2008


On 2 Apr, 15:50, Aaron Watters <aaron.watt... at gmail.com> wrote:
>

[Quoting hdante]

> >  Seriously, you'll forget there's a relational database below. (there
> > are even intefaces for "relational lists", "trees", etc.)
>
> My experience with this sort of thing is that it is a bit
> like morphine.  It can feel really good, and in emergencies
> it can save you a lot of pain.  But if you use it too often
> and too seriously you end up with really big problems.

That's two candidates for quote of the week in the same thread!

I agree with those who question why you'd want to treat a relational
database like a big dictionary, and although the interface between
queries, results and program data structures can often seem quite
awkward, I've come to realise that most object-relational mappers are
solving the wrong problems: they pretend that the database is somehow
the wrong representation whilst being a fast enough black box for
holding persistent data (although I doubt that many people push the
boundaries enough to see that it's not possible to ignore all details
of such a database whilst preserving performance), or they pretend
that languages like SQL (which can be cumbersome, admittedly) are
inconvenient for querying whilst replicating a less concise mechanism
for querying using client language mechanisms.

I'm more encouraged by the idea of "query templating", which might
sound like a recipe for all sorts of problems, but if done right could
provide more effective ways of working with relational databases than
pretending that different things in the database are somehow "objects"
in the client language sense.

Paul



More information about the Python-list mailing list