[Persistence-sig] "Straw Baby" Persistence API

Jim Fulton jim@zope.com
Tue, 23 Jul 2002 10:52:57 -0400


Kevin Jacobs wrote:
> On Tue, 23 Jul 2002, Phillip J. Eby wrote:
> 
>>>There's been a proposal for adding an observer framework to Python.
>>>A suitable general observer framework just might allow the problem to be
>>>solved.
>>>
>>Yes, and any such observer framework is going to have to work via changing 
>>the type, type pointer, or replacing the object, unless it's going to be by 
>>altering the fundamental Python object model.  :)
>>
> 
> I think that this can be done with a light-weight C proxy methods --
> hopefully glued in by an intelligent meta-class.  That way, we do not lose
> much performance, and don't have to butcher Python's object model too much.
> 
> My goal is to migrate towards a persistence system that uses metaclasses and
> proxies to do most of the heavy lifting involved in transforming
> general user-specified objects into persistent objects.

Proxies can be a useful tool. We certainly use them a lot, although
I sometimes feel dirty afterwards. ;)  There are a *lot* of gotchas.
I would definately *not* recommend using them for persistence.  I
would find a persistent mix-in to be far less intrusive than proxies.

Jim

-- 
Jim Fulton           mailto:jim@zope.com       Python Powered!
CTO                  (888) 344-4332            http://www.python.org
Zope Corporation     http://www.zope.com       http://www.zope.org