[ZODB-Dev] AdaptableStorage and ZClass instances

Rocky Burt rocky.burt@bricsnet.com
13 Feb 2003 11:32:55 -0500


On Thu, 2003-02-13 at 11:03, Shane Hathaway wrote:
> Chris Withers wrote:
> > Shane Hathaway wrote:
> > 
> >>
> >> Look at the function at the bottom of Zope2SQL.py.  You just need t=
o
> >> provide an alternative function that creates nearly the same mapper=
 but
> >> connects the mapper to an Oracle database rather than a Postgres 
> >> database.
> > 
> > 
> > I found this significantly harder than I felt it should have been.
> > My guy feeling it that the SQL mapping needs refactoring so the SQL =
is 
> > 'factored out'.
> 
> I did the minimum possible on the SQL mapping to get it working.  It's=
 
> probably not factored well for allowing databases other than PostgreSQ=
L, 
> though I didn't make any intentional ties.
> 
> I've been wondering if it would be possible to blend AdaptableStorage 
> and "Modeling":
> 
> http://modeling.sourceforge.net/
> 
> Modeling generates SQL and makes object access transparent, but I thin=
k 
> it doesn't give you all the advantages of an OODBMS.  The idea I have =
is 
> that AdaptableStorage would let you load and store ZODB objects, 
> untouched, using the Modeling framework.
> 
> > Jean and Roch=C3=A9 at Upfront had some interesting ideas on how to =
go about 
> > 'templating' SQL to make this possible, perhaps they could comment?
> 
> All the relevant code is in the "gateway_sql" subpackage.  We can 
> refactor mercilessly, since the tests have decent coverage.
> 
> Shane


My first impression is that the referred Modeling project is overkill
for what we need.  My suggestion would be to go the route of factoring
out the sql for database compliance for "default" mapping (the mapping
that already exists).

For people adding their own mappings (for their own objects), they will
want complete control on how the data is stored in the db.  I'd suggest
AdaptableStorage provide only a framework for this.  Maybe some sort of
a "define a sql statement for each of these functions" type thing:
  1) inserting an object
  2) deleting an object
  3) updating an object

What I'm envisioning is a really simplified version of J2EE EJB BMP.
(and yes, i'm from java-land, but I like this land better ;))

J2EE =3D Java2 Enterprise Edition
EJB =3D Enterprise JavaBeans
BMP =3D Bean Managed Persistence


ps. I suspect many people will just go ahead and use the default
mappings anyhow.

Regards,
Rocky (r0ky)