[Persistence-sig] "Straw Baby" Persistence API

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


Phillip J. Eby wrote:
> At 10:15 AM 7/23/02 -0400, Jim Fulton wrote:
> 
>> Phillip J. Eby wrote:
>>
>>> At 03:47 PM 7/22/02 -0400, Jim Fulton 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.
> 
> 
> Huh?

Hee hee. Sorry, I expect that you can hide the policies behind the
interface.

...

>>>> 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.
> 
> 
> 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 don't think it would have to much with the type at all. If objects
generate the right events, I think that properly designed observers can
do the necessary work.

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