Re: Singleton vs. Static
- From: "H. S. Lahman" <h.lahman@xxxxxxxxxxx>
- Date: Sat, 23 Sep 2006 22:43:15 GMT
Responding to Moop™...
Hi,
It is a long confused question to me, when to use singleton pattern but
not just using static declaration to class and fields, and when is vice
versa? Thank you!
You use the Singleton pattern when the problem space requires that only one object of a class can exist at a time AND
(1) there are multiple places in the application where the object could be created OR
(2) the object is created within some sort of iteration (i.e., the code of the create context is invoked multiple times).
*************
There is nothing wrong with me that could
not be cured by a capful of Drano.
H. S. Lahman
hsl@xxxxxxxxxxxxxxxxx
Pathfinder Solutions
http://www.pathfindermda.com
blog: http://pathfinderpeople.blogs.com/hslahman
"Model-Based Translation: The Next Step in Agile Development". Email
info@xxxxxxxxxxxxxxxxx for your copy.
Pathfinder is hiring: http://www.pathfindermda.com/about_us/careers_pos3.php.
(888)OOA-PATH
.
- References:
- Singleton vs. Static
- From: moop?
- Singleton vs. Static
- Prev by Date: Re: Abstract public member variales?
- Next by Date: Re: Is this too much OOP?
- Previous by thread: Singleton vs. Static
- Index(es):
Relevant Pages
|