Singleton Properties
Posted
by coffeeaddict
on Stack Overflow
See other posts from Stack Overflow
or by coffeeaddict
Published on 2010-03-08T21:16:57Z
Indexed on
2010/03/08
21:21 UTC
Read the original article
Hit count: 333
c#
|design-patterns
Ok, if I create a singleton class and expose the singleton object through a public static property...I understand that.
But my singleton class has other properties in it. Should those be static? Should those also be private?
I just want to be able to access all properties of my singleton class by doing this:
MySingletonClass.SingletonProperty.SomeProperty2
Where SingletonProperty returns me the single singleton instance. I guess my question is, how do you expose the other properties in the singleton class..make them private and then access them through your public singleton static property?
© Stack Overflow or respective owner