Observer Pattern (if you got some spare time)

Donnal Walter donnal at donnal.net
Wed Jun 25 21:05:32 EDT 2003


Patrick Useldinger wrote:
> Hi,
> following a previous thread on Patterns, I ended up reading the famous 
> book by Gamma et al., and implemented a "kind of" observer pattern.
> If anyone has some spare time and some interest, take a look at:
> 
> http://www.homepages.lu/pu/python.pubsub.py.html
> 
> Your comments are most welcome.

The Observer Pattern can be used for implementing Model-View-Presenter 
architectures. In this case, however, it would be more convenient to use 
weak references to observers so that when a GUI component is dismissed, 
it is *automatically* removed from the observer list.

Donnal Walter
Arkansas Children's Hospital







More information about the Python-list mailing list