Skip to main content

Singleton

  • Chapter
  • First Online:
Design Patterns in .NET
  • 1631 Accesses

Abstract

The Singleton is the most hated design pattern in the (rather limited) history of design patterns. That said, however, it doesn’t mean you shouldn’t use the Singleton: a toilet brush is not the most pleasant device either, but sometimes it is simply necessary.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 34.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Notes

  1. 1.

    Note that, similar to C#, F#’s default implementation also uses lazy. The only difference is that F# has a somewhat more concise syntax: writing lazy(x + y()) automatically constructs a Lazy<’T> behind the scenes.

Author information

Authors and Affiliations

Authors

Rights and permissions

Reprints and permissions

Copyright information

© 2019 Dmitri Nesteruk

About this chapter

Check for updates. Verify currency and authenticity via CrossMark

Cite this chapter

Nesteruk, D. (2019). Singleton. In: Design Patterns in .NET. Apress, Berkeley, CA. https://doi.org/10.1007/978-1-4842-4366-4_6

Download citation

Publish with us

Policies and ethics