Use the Singleton pattern when …



  • You need to ensure there is only one instance of a class.
  • Controlled access to that instance is essential.
  • You might need more than one instance at a later stage.
  • The control should be localized in the instantiated class, not in some other mechanism.