Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Singleton Question
Message
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Miscellaneous
Thread ID:
01454204
Message ID:
01454207
Views:
38
>I was reading this article.
>
>http://www.yoda.arachsys.com/csharp/singleton.html
>
>What is stopping someone from instantiating more than one instance of this class? This design requires you to use the Instance
>property.

You can't instantiate it directly since the default constructor is private so the only way to get an instance is via the static Instance property and, if an instance has been instantiated in the get{} then it returns the same instance. All the other variations are just attempts to make this fail-safe if two 'simultaneous' attempts are made.....
Previous
Reply
Map
View

Click here to load this message in the networking platform