Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
What's a Singleton?
Message
 
À
15/08/2009 12:41:57
Information générale
Forum:
ASP.NET
Catégorie:
Conception classe
Divers
Thread ID:
01417218
Message ID:
01418272
Vues:
61
>>Why not just create a static class?
>
>Short answer: it depends on what purpose the class serves.
>
>In Tim's case, his class needs to be an instance rather than static, because his instance fires events, etc. That wouldn't work with a static class.

That's helpful, thanks!

>
>But, as Tim also says, the Singleton pattern seems to be overused. <g> So, did you have some particular use in mind or is this just a generic question?

It referred to a C# test I saw where the class had to be thread-safe and a singleton.

>~~Bonnie
Everything makes sense in someone's mind
public class SystemCrasher :ICrashable
In addition, an integer field is not for irrational people
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform