[Persistence-sig] "Straw Baby" Persistence API

Jim Fulton jim@zope.com
Wed, 31 Jul 2002 14:23:16 -0400


Phillip J. Eby wrote:
> At 11:35 AM 7/23/02 -0700, Ilia Iourovitski wrote:
> 
...


>> > The most straightforward way to handle queries is by
>> > creating query data
>> > managers, which take OIDs that represent the
>> > parameters of the query.
>> >
>> Most of the time people retrive object by attributes.
>> not by OID.
> 
> 
> Right.  So define a query manager that takes the attributes as fields in 
> an OID, and returns a persistent object that represents a sequence of 
> records.  e.g.
> 
> for object in someQueryMgr[ ('param1value','param2value') ]:
>     ...
> 
> All you need is a separate query manager for each (parameterized) query 
> your app needs -- and again, there's nothting stopping you from 
> generating your own via metadata or even from OQL if that's your heart's 
> desire.

I think queries are entirely different beasts from oids. I would
recommend be inclined to see a data-manager specific query interface
for queries.

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