[Python-Dev] Oberver Pattern

Andrew P. Lentvorski bsder@allcaps.org
Fri, 10 May 2002 15:30:25 -0700 (PDT)


On Fri, 10 May 2002, Raymond Hettinger wrote:

> I would like to know what you all think about formalizing an observer
> protocol for python objects.

How do you reconcile the range of subject/observer coupling and the
complexity of the notify object?  At one end, the subject sends out all
the necessary data for the observer to update its view without querying
the subject at all.  At the other end, the subject merely sends out a
minimal notify and the observer has to figure out what changed.  Do you
intend to allow this flexibility or do you intend to impose one particular
implementation?

While I would love a formalized, reviewed set of python modules
implementing patterns, I don't understand why you would want to do this at
the C level.  The normal advantage to going to C is performance.  As a
rule of thumb, the observer pattern and performance are mutually
exclusive.

-a