Singleton vs. Static



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!

Regards,
Sam Huang

.



Relevant Pages

  • Re: Singleton vs. Static
    ... It is a long confused question to me, when to use singleton pattern but ... not just using static declaration to class and fields, ... You use the Singleton pattern when the problem space requires that only one object of a class can exist at a time AND ... the object is created within some sort of iteration (i.e., the code of the create context is invoked multiple times). ...
    (comp.object)
  • Re: Singleton vs. Static
    ... not just using static declaration to class and fields, ... You use the Singleton pattern when the problem space requires that only one object of a class can exist at a time AND ... the object is created within some sort of iteration (i.e., the code of the create context is invoked multiple times). ... I don't think the problem space doesn't have much to do with it. ...
    (comp.object)