[ZODB-Dev] Re: Dynamic Wrapper?

Chris Spencer gmane.20.evilspam at spamgourmet.com
Mon Dec 26 16:00:21 EST 2005


Tim Peters wrote:

> If that's the goal, you may be alone in caring about it ;-):  manual
> fiddling of _p_changed is rarely needed outside the _implementation_ of
> persistence.  If you find yourself doing it a lot, there may be a flaw in
> your design, or in your mental model of how persistence in ZODB actually
> works.

My goal was to try and make ZODB a little more transparent. In an ideal 
world, persistence shouldn't require any modification of your classes. 
Transitive closures, reachable states, and unique identifiers should be 
Zope's responsibility alone, not the user's. Since _p_changed is used in 
several Zope tutorials illustrating how to write classes that can "tell" 
Zope your data has changed, my example code attempted (unsuccessfully it 
would seem) to render _p_changed obsolete by allowing Zope to 
automatically detect changes. Of course, I realize there's more to 
persistence than that. It was just an idea.

Chris



More information about the ZODB-Dev mailing list