Observer Pattern (if you got some spare time)

Patrick Useldinger a at b.c
Tue Jun 17 12:43:14 EDT 2003


Troy Melhase wrote:

> A quick read of the code suggests that the comment is in error; I don't see
> any reason why clients couldn't construct multiple instances of the PubSub
> class.  There are no classmethods, no staticmethods, and no references to
> the PubSub class by any code other than the example client at the bottom. 
> 

What I wrote is that you *shouldn't* need multiple instances, not that 
you *mustn't* have them. As you point out, you can have as many 
instances as you want, but having only one seems more natural to me.

I really designed this pattern with MQ Series in mind. The object is the 
queue manager, and the subject is the queue name. With MQ, you wouldn't 
create multiple queue managers, you would just agree on a queue name.

-Patrick

-- 
Real e-mail address is 'cHVAdm8ubHU=\n'.decode('base64')
Visit my Homepage at http://www.homepages.lu/pu/





More information about the Python-list mailing list