RELEASED [OOPS - The Python Datastore v0.9]

Michal Wallace sabren at manifestation.com
Thu Feb 14 12:33:49 EST 2002


On Wed, 13 Feb 2002, Dan P wrote:

> OOPS achieves transparent persistence in the Python
> environment by mirroring the python namespace over top of
> a shelve-like database.  Behavioral methods were added to
> classes to make the bind to each other and receive extra
> identification information so each object could build a
> unique identifying database key in which it stores
> persistent data.


Hey Dan! I've been working on a very similar thing for some
time, except my stuff stores data in a relational object.
I've been working on revamping it to use metaclasses the way
you do - I love your "Definition" class.

Looking through the docs, I have a suggestion: I think you
could gain a lot by decoupling your "Obj" classes from any
particular type of storage.

One way to do this is through the Observer pattern. You
create another object that can fetch and store your
Obj-style classes, and once it fetches one, can listen to it
for changes.  Obj, on the other hand, would fire off events
whenever a property changes.

The benefit is that you can then use the psuedo-static
typing scheme you've created anywhere, including storing
them to a database, ZODB, or as models in a true 
model-view-controller scheme.

[I'm actually working on this sort of scheme.. if you're
interested, maybe we could work together.]

Cheers,

- Michal   http://www.sabren.net/   sabren at manifestation.com 
------------------------------------------------------------
Give your ideas the perfect home: http://www.cornerhost.com/
 cvs - weblogs - php - linux shell - perl/python/cgi - java
------------------------------------------------------------





More information about the Python-list mailing list