[Persistence-sig] "Straw Baby" Persistence API

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


Ilia Iourovitski wrote:
> --- Jim Fulton <jim@zope.com> wrote:
> 

...

>>>create(object) storage shall populated id from
>>>
>>rdbms
>>
>>>which is usually primary key.
>>>
>>This should not be necessary. One should be able to
>>design a data manager that detected new objects and
>>assigned them ids when referencing objects are
>>created.
>>
> 
> Typical storage (rdbms, odbms, xml like xindicea)
> do not provide root object.
 > So after transaction
 > started
 > object must be loaded from storage or created.

This is a good point. There often isn't
a single root objects that are objects are reachable
from. On the other hand, most non-trivial relationaql
systems have related objects. Most objects are reachable
from other objects. It should be possible to load objects
automatically when traversing to them from other objects.

In addition, if a new object is added to another object, it
should bve possible to add the new object to the database
automatically.

>>>delete(object) 
>>>
>>I can imagine a datamanager that lacked garbage
>>collection could
>>need this.
>>
>>
> in case of rdbms there are objects which are not
> referenced. 

Right.

>>>load(object type, object id)->object
>>>
>>An object type should be unnecessary. If a data
>>manager
>>needs to track this sort of information, it should
>>embed it in the object id.
>>
> 
> In rdbms case id usually integer. adding the whole
> package/class name can be expensive.

That depends on how you do it, the object id need not
be ythe same as the primary key and could encode the
class in a more efficient manner than storing the
package and class names.


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