F
Faust
Hi,
i'm implementing a singleton class, and changing non static to static
functions, vars, properties one after another I discover all my
implementation can be done as static in the class so there's no need of
singleton instance to use it.
to extend thinking, I wonder in which cases the singleton pattern is
still useful (in C# at least) as, AFAIK, everything we declare in a
class to be instance dependant can be declared static
even constructor and event handlers have their static alternative
the only case I see it's still useful, is with events and sender param:
if no singleton instance, we have to use null as sender or to declare
specific event handler types
did I missed something ?
--
*/Teträm/*
http://www.tetram.org
"Entre le cerveau et la main, le médiateur doit être le coeur" - Fritz
Lang
i'm implementing a singleton class, and changing non static to static
functions, vars, properties one after another I discover all my
implementation can be done as static in the class so there's no need of
singleton instance to use it.
to extend thinking, I wonder in which cases the singleton pattern is
still useful (in C# at least) as, AFAIK, everything we declare in a
class to be instance dependant can be declared static
even constructor and event handlers have their static alternative
the only case I see it's still useful, is with events and sender param:
if no singleton instance, we have to use null as sender or to declare
specific event handler types
did I missed something ?
--
*/Teträm/*
http://www.tetram.org
"Entre le cerveau et la main, le médiateur doit être le coeur" - Fritz
Lang