From: Erik V. <eri...@hc...> - 2005-04-27 17:59:14
|
> > > Though, now that I think about it, perhaps Bank should be a > > > totally static > > > class? > > > > It could be, sure. > > It's now a singleton, though not very well managed. > > > > It just seems like this is one of the rare instances that I can not > envision needing more than one of these. That is why it is a singleton - exactly one instance. Of course, often singletons can as well be "zerotons" - just class (static) methods, as you propose. This is OK if subclassing is not an issue. But if we have to count with "extended" Bank functionality in a possible future subclass, a singleton is better. Erik. |