Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Singleton Question
Message
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Divers
Thread ID:
01454204
Message ID:
01454207
Vues:
39
>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.....
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform