HOME | REACH US  
 



.com .net .org .info .mobi
.biz .us .co.uk .in
.eu .ws .bz .cc .tv Etc.
Domain Names

Website Development
Web Hosting
Email Hosting
Digital Certificate
Etc.

@ Best Prices From

www.DomainsUAE.com
Null Object pattern
   
Google
 
Web libraryoflibrary.com

In object-oriented computer programming, a Null Object is a behavioral pattern designed to represent the absence of an object.

Contents

Motivation

In most object-oriented languages, such as Java, references may be null. These references need to be checked to ensure they are not null before invoking any methods, because one can't invoke anything on a null reference.

Alternate Patterns

Instead of using a null reference to convey absence of an object (for instance, a non-existent customer), one uses an object which implements the expected interface, but whose method body is empty. The advantage of this approach over a working default implementation is that a Null Object is very predictable and has no side effects: it does nothing.

For example, the processing of binary search trees, including operations such as insertion, deletion, and lookup, involves many nullity check of the encountered pointers. These checks can be implemented within the special object pattern.

The null object pattern can also be used to act as a stub for testing if a certain feature, such as a database, is not available for testing.

Relation to other patterns

It can be regarded as a special case of the State pattern and the Strategy Pattern.

It is not a pattern from Design Patterns, but is mentioned in Martin Fowler's Refactoring[1] and Joshua Kerievsky's[2] book on refactoring in the Insert Null Object refactoring.

Chapter 17 is dedicated to the pattern in Robert Cecil Martin's Agile Software Development: Principles, Patterns and Practices[3]

References

  1. ^ *Fowler, Martin (1999). Refactoring. Improving the Design of Existing Code, Addison-Wesley. ISBN 0-201-48567-2. 
  2. ^ *Kerievsky, Joshua (2004). Refactoring To Patterns, Addison-Wesley. ISBN 0-321-21335-1. 
  3. ^ *Martin, Robert (2002). Agile Software Development: Principles, Patterns and Practices, Pearson Education. ISBN 0-13-597444-5. 

External links



Index Of Related Pages




All pages | Previous page (Nuggets, Vol. 9: Acid Rock) | Next page (Numb (Linkin Park song))

Null Object pattern
Null allele
Null and Void Ordinance
Null cellNull character
Null cipher
Null corrector
Null distributionNull dust solution
Null fillNull function
Null graph
Null httpdNull hypothesis
Null instantiation
Null modemNull morpheme
Null move
Null resultNull route
Null sessionNull set
Null subject languageNull surface
Null vector
Null vector (disambiguation)
Nulla in mundo pax sincera
Nulla poena pro vitium AbyssusNulla poena sine lege
Nullable type
Nullagine, Western Australia
NullahNullah (disambiguation)
Nullarbor, South Australia
Nullarbor (demo party)Nullarbor (disambiguation)Nullarbor National Park
Nullarbor NymphNullarbor Plain
Nullarbor Regional Reserve
Nullary constructor
NullatorNullawil, Victoria
NullclineNulle terre sans seigneurNullemont
NullerNulles
NullificationNullification (U.S. Constitution)
Nullification ConventionNullification Crisis
Nullifier Party
Nullisomic
NullityNullity (conflict)
Nullity (graph theory)
Nullity of Marriage Act 1971
Nullity theorem
NulloNullor
NullsleepNullsoft
Nullsoft Scriptable Install System
Nullsoft Streaming Video
Nulltown, Indiana
Nullum crimen, nulla poena sine praevia lege poenali
Nullum tempus occurrit regi
NullyNully-TrémillyNulogy
NulviNulyarimma v Thompson
NumNum, Nepal
Num-Torum
NumPy
Num RiNum lock
Numa
Numa, Iowa
Numa Ayrinhac
Numa Denis Fustel de CoulangesNuma DrozNuma F. Montet
Numa MorikazuNuma Numa
Numa PompiliusNuma Ridge Fire Lookout
Numa Sadoul
Numabe Station
Numair Salmalín
Numakubo StationNumakullaNumakuma, Hiroshima
Numakuma District, HiroshimaNumaligarh
Numaligarh Refinery LimitedNumaligarh Refinery TownshipNuman
Numan (race)Numan Athletics
Numan Gumaa
NumanaNumana (Titular See)Numancia
Numancia, AklanNumancia de la Sagra
Numanohata Station
Numansdorp
Numantia
Numantine War
Numara SoftwareNumari
NumarkNumark (DJ equipment)Numark (pharmacy)
Numark CUE
Numata, Gunma
Numata, HokkaidoNumata (moth)
Numatic International Limited
Numazu, ShizuokaNumazu-juku
Numazu DomainNumazu Station
Numb
Numb/Encore
Numb3rs

Previous page (Nuggets, Vol. 9: Acid Rock) | Next page (Numb (Linkin Park song))



BUILD YOUR WEB SITE WITH www.DomainsUAE.com