Skip to main content

Null Object

  • Chapter
  • First Online:
Book cover Design Patterns in .NET
  • 1621 Accesses

Abstract

We don’t always choose the interfaces we work with. For example, I would rather have my car drive me to my destination by itself, without me having to give 100 percent of my attention to the road and the dangerous lunatics driving next to me. It’s the same with software: sometimes you don’t really want a piece of functionality, but it is built into the interface. So what do you do? You make a Null Object.

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.

    ImpromptuInterface is an open-source dynamic “duck casting” library built on top of DLR and Reflection.Emit. Its source code is available at https://github.com/ekonbenefits/impromptu-interface and you can install it directly from NuGet.

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). Null Object. In: Design Patterns in .NET. Apress, Berkeley, CA. https://doi.org/10.1007/978-1-4842-4366-4_20

Download citation

Publish with us

Policies and ethics