[ZODB-Dev] Reachability and GUI apps

Christian Robottom Reis kiko at async.com.br
Wed Jun 30 21:27:44 EDT 2004


On Wed, Jun 30, 2004 at 02:18:47PM -0500, Rad Widmer wrote:
> Subject, so that GUI objs can observe it. When a GUI object wishes to
> observe the Part object, it calls an attach method on the Part object,
> which saves a reference to the GUI obj in the Part obj.  The problem
> is, now I have GUI objects which are reachable from my persistent
> objects, and so the GUI objs would be persisted along with the domain
> objects.
> 
> Is my understanding of reachability correct? Has anyone had a similar
> situation, and how have you handled it? 

Yes; I had a similar issue with the Kiwi Model class. The approach I
used (which may be called somewhat canonical with the ZODB) is storing
this data in an attribute with a name starting with _v_, which indicates
it is "volatile" and not stored with the Persistent object's state.

Interesting that your GUI classes model exactly what the Kiwi Model and
Proxies do. Check them out if you like; there's a tutorial up at

    http://www.async.com.br/projects/kiwi/howto/

You can see the _v_ evil at work in Models.py:

    http://cvsweb.async.com.br/index.cgi/Kiwi/Kiwi/FrameWork/Models.py?rev=1.2;content-type=text%2Fplain

Take care,
--
Christian Robottom Reis | http://async.com.br/~kiko/ | [+55 16] 3361 2331


More information about the ZODB-Dev mailing list