1

Possible Duplicate:
Singleton: How should it be used

I've read that singletons are bad. For instance, it makes the code hard to test. Are there any acceptable uses of singletons?

Community
  • 1
  • 1

1 Answers1

0

Sometimes you want one and only one connection to a database. Making your connector a singleton ensures that you will not spin up multiple connections.

Daniel Williams
  • 8,912
  • 15
  • 68
  • 107