in reply to Singletons and Inheritance
If your client code has a design reason to know it's dealing with a singleton, you might have a stylistic incentive to use different names, otherwise, make it transparent.
The most elegant way I know of applying singletonhood to a class (if you don't mind introducing new tech) is with the Aspect module. All your code remains the same; you just say
use Aspect::Singleton; aspect Singleton => 'Foo::new';
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Singletons and Inheritance
by PerlingTheUK (Hermit) on Jul 20, 2004 at 12:53 UTC | |
by gaal (Parson) on Jul 20, 2004 at 13:22 UTC |