[Persistence-sig] "Straw Baby" Persistence API
Ilia Iourovitski
iiourov@yahoo.com
Tue, 23 Jul 2002 10:08:36 -0700 (PDT)
--- Jim Fulton <jim@zope.com> wrote:
> Ilia Iourovitski wrote:
> > For RDBMS based storages api should
> > provides the following method:
>
> I'll first note that, if these methods are needed
> at all, they should be methods on a specific data
> manager.
> They do not affect the transaction or the
> persistence
> frameworks.
>
>
> > 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.
>
> > 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.
> > 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.
>
> Note also, that persistence applications load most
> objects
> automatically through object traverssal. It is often
> necessary to explicitly load one or more root
> objects to
> provide a starting place for traversl.
>
>
> > query(string, parameters)->list of objects or
> smart
> > collection
> >
> > Those methods can be placed in
> > Persistence/IPersistentDataManager.py
>
> No, these methods are specific to particular data
> manager
> APIs, although I can imagine a number of data
> managers sharing an
> API like the one above. Note that
> IPersistentDataManager.py is
> an interface for use by persistent objects. It does
> not include
> all data-manager methods. Similarly,
> Transaction.IDataManager.IDataManager is the
> data-manager API
> used by the transaction framework.
>
And most storages like rdbms, ldap, xml has it.
> Data managers will implement
>
Persistence.IPersistentDataManager.IPersistentDataManager
> and
> Transaction.IDataManager.IDataManager as well as
> application APIs
> like the one you propose above. Perhaps there should
> be some
> common data-manager application API somewhat like
> the one you propose
> above.
>
> 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
>
__________________________________________________
Do You Yahoo!?
Yahoo! Health - Feel better, live better
http://health.yahoo.com