[Zope-PTK] Re: [PTK(94)[1] request] Changing document views hard

Martijn Pieters mj@digicool.com
Sat, 10 Jun 2000 08:14:46 +0200


On Fri, Jun 09, 2000 at 08:17:11PM -0400, Tres Seaver wrote:
> WRT Observable, I just checked in today a first cut at the
> DefaultObservable
> implementation.  See $CVS_ZOPE/lib/python/OFS/DefaultObservable.py.
> The interfaces are in the Interfaces wiki:
> 
>  <URL
> http://www.zope.org/Members/michel/Projects/Interfaces/ObserverAndNotification>
> 
> Adventurous souls can begin tinkering with it, and tell me
> where I messed up :)

Looking at the code, everything looks good to me. One point: 

Would it be a good idea if removing of a non-exisiting observer did not raise
an exception? 

Imagine that a Observer first called unregisterObserver for itself on the
Observable, then raised an exception. The Observable object then adds the
Observable to the list of bozos, and afterwards tries to unregister the
Observer, it has to eat the exception, but it doen't handle it.

Either, the code unregistering should expect an exception, or the
unregistering code should catch it and not let it pass on.

-- 
Martijn Pieters
| Software Engineer    mailto:mj@digicool.com
| Digital Creations  http://www.digicool.com/
| Creators of Zope       http://www.zope.org/
|   The Open Source Web Application Server
---------------------------------------------