[Zope-dev] Experiments with ORMapping
John D. Heintz
jheintz@isogen.com
Mon, 14 May 2001 11:22:12 -0500
I think this is a great idea! I would definetely like to use and contribute
to this effort. Having this kind of flexibily would be fantastic.
After demonstratable Python code is working I would request that usability
issues (UI Schema mapper, data migration/schema evolution tools, ZEO
integration, multi-Storage uses) be addressed sooner than later.
John
On Monday 14 May 2001 10:47, Shane Hathaway wrote:
> Chris Withers wrote:
> > Shane Hathaway wrote:
> > > I'm telling you there's a lot more you can do with the code that makes
> >
> > <snip>
> >
> > > The next thing to do is to write a fishbowl proposal.
> >
> > This sounds cool but made my head hurt :-S
> >
> > Can you try and bring this back down to the level of us mere mortals by
> > explaining how your OR stuff would let me take a table of data in an
> > RDBMS table and have it appear as objects in the Management Inteferace?
>
> Sorry, this is at a pretty low level and I do need to explain it better.
>
> One would define an "ObjectMappingSchema" whose job it is to store and
> retrieve objects of a specific type and in a specific location. It
> would usually grab a database connection object to do its work. When
> loading, it would perform a query then manually put attributes into a
> persistent object. When storing, it would grab specific attributes from
> the persistent object and execute a statement to store those attributes.
>
> So let's say you want a ZODB to store and retrieve users in a specific
> table while putting everything else in pickles. You would create an
> instance of PickleSchema, which implements the ObjectMappingSchema
> interface, and tell it to manage everything *except* the users mapping
> in BasicUserFolder objects. You would tell it to store and retrieve
> this object using your UserFolderSchema instead. Your UserFolderSchema
> would store and retrieve the users from the USERS and USER_PREFS
> tables. The user table wouldn't require the use of OIDs but would
> require unique user IDs.
>
> So in the management interface nothing would change. Nor would the
> application-level Python code. You would only define a layer that maps
> objects to a relational database. You would still see the user folder
> as you do now.
>
> Now, it may be useful to provide a management interface for defining the
> schema mapping. I haven't approached that yet; AFAICT this is where the
> work done on SmartObjects and DBObjects would be very useful. Initially
> I was planning for people to code the mapping purely in Python so we
> could gain experience and find common patterns before inventing a UI.
>
> Shane
>
> _______________________________________________
> Zope-Dev maillist - Zope-Dev@zope.org
> http://lists.zope.org/mailman/listinfo/zope-dev
> ** No cross posts or HTML encoding! **
> (Related lists -
> http://lists.zope.org/mailman/listinfo/zope-announce
> http://lists.zope.org/mailman/listinfo/zope )
--
. . . . . . . . . . . . . . . . . . . . . . . .
John D. Heintz | Senior Engineer
1016 La Posada Dr. | Suite 240 | Austin TX 78752
T 512.633.1198 | jheintz@isogen.com
w w w . d a t a c h a n n e l . c o m