Skip to Content
Software Architecture Design Patterns in Java
book

Software Architecture Design Patterns in Java

by Partha Kuchana
April 2004
Intermediate to advanced
520 pages
10h 10m
English
Auerbach Publications
Content preview from Software Architecture Design Patterns in Java

37 NULL OBJECT

This pattern was previously described in Woolf96, Grand98.

DESCRIPTION

The term null is used in most computer programming languages to refer to a nonexisting object. The Null Object pattern is applicable when a client expects to use different subclasses of a class hierarchy to execute different behavior and refers these subclasses as objects of the parent class type. At times, it may be possible that a subclass instance may not be available when the client expects one. In such cases, what a client object receives is a nonexisting object or null. When a null is returned, the client cannot invoke methods as it would if a real object is returned. Hence the client needs to check to make sure that the object is not null before invoking ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Hands-On Software Architecture with Java

Hands-On Software Architecture with Java

Giuseppe Bonocore

Publisher Resources

ISBN: 9780203496213