[Zope] Change Notification
Tres Seaver
tseaver@palladion.com
Wed, 21 Jun 2000 15:06:47 -0400
Itamar Shtull-Trauring <itamar@maxnm.com> wrote:
>
> Bob Barter wrote:
> >
> > Is there a way for an object to be notified that it has been
> > modified?
>
> Use ZPatterns 0.4, it allows you to be notified of events - change,
> add and delete of objects.
I may be confused, but normally the object should _know_ that it has
been modified, because one of its methods has been called. In fact,
the usual pattern for this is to have the object notify other
interested parties ("Observers") of the fact that it has changed.
2.2 has experimental support for this -- see
$ZOPE/lib/python/OFS/DefaultObservable.py. Also, see the writeup
on this in the Intefaces wiki (start from
http://www.zope.org/WikiCentral -- look for ObserverAndNotification.
Tres.