[ZODB-Dev] Reachability and GUI apps

Christian Robottom Reis kiko at async.com.br
Thu Jul 1 19:44:43 EDT 2004


On Thu, Jul 01, 2004 at 04:35:23PM -0500, Rad Widmer wrote:
> Thanks for the links. I took a look at Models.py and Proxies.py. I can
> see where you recreate the _v_ attributes as needed, but I don't see
> how the proxies get re-registered with their models. I guess this
> would need to occur when the model's persistent state is reloaded (the
> model transitions from ghost to up-to-date state).

You're right; our applications never hold an object across transaction
boundaries in the same interface (most of the editing work is open
dialog, change, OK, commit). 

Unfortunately, what you want doesn't seem to be very easy to implement
-- you want something persistent, but not very much :-) A 5-cent idea
you could try this would be somehow maintaining an external observer
registry (in some module-bound state) with which the observer looked up
(via a string key, perhaps) the proxies/views it was originally
registered with.

Having said that, I've come to understand that having the actual
persistent object used in the interface may not be the best strategy;
I'm experimenting with non-persistent adapters that hold data and
implement part of the object's business logic and that have specific
commit-like APIs in which they communicate changes to the underlying
persistent object. Another level of indirection, but another level of
flexibility and reusability as well.

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


More information about the ZODB-Dev mailing list