2

Possible Duplicate:
Difference between static class and singleton pattern?

I'm thinking about the choice between Static classes and Singleton pattern on C#.

Do you know how static classes are created? In particular, I would know if a static class is unique during program execution and what are pro or cons against Singleton pattern.

Thank you in advance.

Community
  • 1
  • 1
Lorenzo B
  • 33,216
  • 24
  • 116
  • 190
  • This has been asked several times before, latest *yesterday*. Searching before asking is a good rule :) – Øyvind Bråthen Apr 06 '11 at 11:29
  • I love the "Related" sidebar below the adds. It helps a lot finding duplicates. This one in particular, is full of them. And there's also the auto-search-before-asking feature, that after you type the title of your question shows you similar questions. With this exact title it shows the same 61-upvotes question I linked to. – R. Martinho Fernandes Apr 06 '11 at 11:40

1 Answers1

1

A static class can not be instanciated. A singleton can be instanciated once.

Discussion about the use of the Singleton pattern

And more here

Community
  • 1
  • 1
Emond
  • 50,210
  • 11
  • 84
  • 115