Posts tagged with singleton

  • Exceptions using type initializer based singletons

    Jun 9, 2011

    A popular web page describing how to implement a singleton in C# is this one, where several ways to implement a singleton are discussed. I usually pick the last option, which, according to the author of that page, has the most benefits. The author goes on to mention some problems that can occur if an exception is thrown in the constructor, but I never paid attention to that until recently.