in reply to Re: Design of a global-variable storage package
in thread Design of a global-variable storage package
You both appear to have overlooked the very simple alternative:
my $p= 'Getopt::Long::Framework'; $p->What(); $p->Ever();
But I don't buy the 'singleton' concept in general. Even CGI.pm realizes that sometimes There Can Be More Than One, even for things where that is almost never wanted and it is easy to fail to see any cases when someone would want Two.
Implement your functionality using plain (non-singleton) objects and just provide a handy shortcut for getting the default, global instance. Then you have the benefits of 'singleton' without the limitations.
- tye
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Design of a global-variable storage package (string)
by Tanktalus (Canon) on Nov 23, 2005 at 17:55 UTC | |
by tye (Sage) on Nov 23, 2005 at 21:11 UTC |