[Persistence-sig] "Straw Baby" Persistence API

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


Phillip J. Eby wrote:
> At 03:47 PM 7/22/02 -0400, Jim Fulton wrote:
> 
>> Phillip J. Eby wrote:
>>
...


>> I think that there should, at least, be a standard cache interface.
>> It should be possible to develop data managers and caches independently.
>> Maybe we could include one or two standard implementations. These could
>> provide useful examples for other implementations and, of course, be
>> useful in themselves.
> 
> 
> Sure.  I personally don't think there's much that you can standardize on 
> in a caching API besides which mapping methods one is required to 
> support, without getting into policy and use cases. 

I expect that you can hide behind the interface.

...

>>> I think maybe I was unclear.  I certainly don't think that the 
>>> interfaces should cease to exist, or that they should not exist as 
>>> documentation.  I'm referring to their inclusion as operating code, 
>>> only.
>>
>>
>> So you don't want them to get imported?
> 
> 
> It's not that I care one way or the other.  Honestly, I'd rather see 
> Interface end up in the standard library too - at least once the 
> metaclass bug is fixed.  :) 

Whqat metaclass bug?

 > But my overriding priority here is a
> standard for Persistence and Transaction bases for eventual inclusion in 
> the standard library.

I'd like to keep the interfaces but make them resilient to the absense
of the interface package. I'll deal with those details.


....

>> True. But maybe someone will think of a way to solve this without proxies
>> or alchemy?
> 
> 
> Unless you're going to fundamentally alter the Python object model, it's 
> not doable.  Python objects by definition get their behavior from their 
> type.  To change the behavior, you must either change the type, the type 
> pointer in the object, or replace the object with another one.

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.


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