From: Ype K. <yk...@xs...> - 2002-03-22 23:24:31
|
Stephen, >Hi, > >I have read lots of stuff on creating the singleton design pattern using >python and to be honest most of this information has left me confused. >What is the best way to create the singleton in jython? There is no single best way. You can use the borg pattern (use google to look for: python borg pattern singleton). Or you implement the singleton using module semantics: class aSingle: pass theSingle = aSingle() and use itsModule.theSingle as the singleton. Or you can implement it in java as a singleton, and access it from from jython. There are probably at least a few more other ways. >Thanks Cheers, Ype -- |