no singletons, please (was Re: an example Re: Connecting to running win32com server)

spahievi spahievi at vega.bg
Fri Oct 13 11:23:25 EDT 2000


AM> Fine, but letting client code access it through class instances
AM> is often a good idea anyway.  In COM, for example, it's
AM> absolutely mandatory, since you _must_ give out to clients
AM> what amount in Python terms to class instances.  In the
AM> Singleton Pattern, one would strive to give out the same
AM> instance to each client (leading to problems of various kinds);
AM> in the "instances sharing state" pattern (which needs a flashier
AM> name:-), one blissfully gives out instances at will, and just
AM> has each of them delegate its state.

What about "Proxy to Singleton"? ;)

-- 
Best regards,
 Niki Spahiev






More information about the Python-list mailing list