Matt Gerrans
Posts: 1153
Nickname: matt
Registered: Feb, 2002
|
|
Re: The Singleton Pattern
|
Posted: Apr 14, 2002 10:06 PM
|
|
Well, I can't claim to be an expert, but it sounds interesting.
I think generally that static should not be used too indiscriminantly. It may work at first, but as you have discovered, it makes for inflexible code.
There is a difference between having a singleton and using static, however. Although, if you have a singleton, I suppose you could arrange it so that it works with static or non-static methods (when the class is first accessed, it creates the singleton, saves a reference, then all the static methods can refer to it).
I'm not sure what you mean by clustering. Do you mean that you have several application servers running the same code? Also, what is the effect you are trying to get? Do you want each node to have its own collection (Vector) of sessions, or do you want them to share the collection?
|
|