Tuesday, December 25, 2007

Singleton Pattern (3) Things to note

  • The constructor could be protected or private
  • Do not implement ICloneable interface
  • Do not use Serialization
  • Will create more instances in a multi-threading environment

This article will talk about how to program a singleton into a fully lazily-loaded, thread-safe, simple and highly performant version: Implementing the Singleton Pattern in C#

blog comments powered by Disqus