[ZODB-Dev] How to predict George Bailey?

Toby Dickenson tdickenson@geminidataloggers.com
Fri, 1 Nov 2002 17:15:14 +0000


On Friday 01 November 2002 5:12 pm, Magnus Lycka confused me by writing:

> How can I predict whether an undo operation will cause
> objects to be uncreated?
>
> I *could* do something along this line:
>
> 1. Before undo, let every window get a copy of the objects
>     application specific OID (Not ZODB's.)
> 2. Undo/commit/sync.
> 3. Let every open window search for the OID in the database.
> 4. Close window if OID not found.

Why is an undo transaction that creates a George Bailey any different fro=
m any=20
other transaction that changes an object? You still need to resync the wi=
ndow=20
- possibly by changing the data, possibly by closing the window.

> I'd prefer if there were fewer steps though. I employ an
> Observer pattern, so that Windows close if a displayed object
> is removed from another window for instance.

what triggers the event to which the observers subscribe? why can it hand=
le=20
some types of changes but not others?