Null Object Refactoring
page 1 of 5
Published: 14 May 2007
This article will give an overview of the Introduce Null Object refactoring. The Null Object makes it easier to specify a null value in a business system, and this article will show you how.
by Brian Mains
Average Rating: This article has not yet been rated.
Views (Total / Last 10 Days): 26524/ 50


Martin Fowler wrote a book called "Refactoring: Improving the Design of Existing Code," and in the book he discusses the "Introduce Null Object" refactoring. Instead of assigning a null value to a reference-type property, a nullable object can be used to represent a null value, instead of directly assigning a null value itself. This makes it easier to reference and you do not have to worry about getting a null exception when using the property. Here is how it works.

View Entire Article

User Comments

Title: good write-up   
Name: HoyaSaxa93
Date: 2007-05-15 3:26:44 PM
good examples of factoring / backing into null objects

Community Advice: ASP | SQL | XML | Regular Expressions | Windows

©Copyright 1998-2024  |  Page Processed at 2024-06-17 8:40:26 PM  AspAlliance Recent Articles RSS Feed
About ASPAlliance | Newsgroups | Advertise | Authors | Email Lists | Feedback | Link To Us | Privacy | Search