Everything I've came across so far says that "helper" classes that don't have state are an ideal situation to use the static modifier. But what if the class manages some kind of "state", but you only ever need 1 instance of the class, and it needs to live for the lifetime of the application? I understand the "singleton pattern" can be applied in this situation, but would just marking the class and all its members as static be appropriate design as well? Would making it a normal class and keeping it as a global structure be better design?
Basically, I want to learn everything there is to 'static'. Memory implications, when it's appropriate to use it, when it's not appropriate to use it, performance, etc. Obviously this might be too much to explain in this topic, but if you know of any good c# books that cover the static modifier in depth, I would appreciate a link to the book. Any good online references to some of my questions would also be appreciated, but everything I've came across so far doesn't answer everything I'm wondering about 'static'.
This post has been edited by Rhino1111: 23 September 2013 - 04:00 PM