|
From: Ian B. <ia...@co...> - 2003-11-10 20:56:52
|
On Nov 10, 2003, at 2:42 PM, John Baker wrote:
> class Area (SQLObject):
>
> class Office (Area):
>
> class Home (Area):
>
> SQLObject creates three tables, with a foreign key from Home -> Area=20=
> and
> Office -> Area.
>
> This means I can do:
>
> class Person (SQLObject):
> areas =3D ReferenceJoin("Area"...)
>
> and map a Person to a number of Areas, without having to map him to=20
> Office and
> Home via two join tables.
>
> Someone said superset mapping wouldn't be happening, which is a shame,=20=
> as it's
> the most obvious and logical choice of the majority of OO mapping.
That was probably me. I find it difficult to map between class=20
hierarchies and tables, and I don't like the ambiguity or arbitrariness=20=
of how that mapping has to happen.
=1F
Which isn't to say I'd be opposed to superset mapping, I'd just rather=20=
that it not look like Python inheritance. To me it's more of an=20
implicit join. Or the folding together of multiple tables. Or... I=20
don't know. When I see a metaphor that looks better, and hopefully=20
doesn't involve terms (or even concepts) like "implicit" or "folding",=20=
then maybe I'll feel more enthusiastic. I'm trying to avoid magic to=20
the degree possible, which is where my reluctance comes from.
--
Ian Bicking | ia...@co... | http://blog.ianbicking.org
|