[ZODB-Dev] Re: AdaptableStorage and OR mapping strategy (was: AdaptableStorage
and ZClass instances)
Chris Withers
chrisw@nipltd.com
Tue, 25 Feb 2003 14:51:18 +0000
RochX Compaan wrote:
>
> I had some time this weekend and decided to prototype a SQL properties
> mapper that does not map all instance attributes to a single SQL table
> but maps properties of a specific metatype to its own table. Instead of
> each property taking up a record of its own I mapped properties to
> columns of the equivalent type in the RDMBS. So if I have a class Person
> with properties Name and Surname, I end up with a table with the same
> name in my RDMBS and the columns Name and Surname of the type "varying
> character (255)" (when using Postgres). The benefit is that it makes the
> data much more queryable, joins simpler and provides a better fit for
> the query power that the RDBMS offers.
Yeah, this is getting closer to a true relational mapper.
What you really want is a mapper that behaves like this for properties the most
objects of a type* have and a 'bucket' mapper that shoves any little extras
people have added to specific objects somewhere else.
Now, deciding what attributes go in the type-specific table and what goes in the
'bucket' is very domain specific. That's something I'd like to twiddle through
the web, or at worst in dbtab.conf.
Is that possible?
* type currently means metatype for AS, right? What about CMF content objects? I
have plenty of these which are of the same metatype but which have property sets
defined by their CMF content type. Can AS support descrimination based on this?
It should, and if it doesn't now, I'd like to help it do so in the future :-)
cheers,
Chris