Talk:Null Object pattern
From Wikipedia, the free encyclopedia
This article is completely wrong. Null pointers and Null variables have little or nothing to do with the Null Object design pattern. http://www.cs.oberlin.edu/~jwalker/nullObjPattern/
- Maybe I phrased things badly - my understanding is that one reason for the pattern is to avoid the checking needed to make sure a variable doesn't have a Null pointer or value as these add to the complexity of code, making it harder to maintain. If I'm mistaken, I'd gladly like to learn better. Autarch 12:23, 28 September 2007 (UTC)
- Upon reading the article, I thought that you were saying that we were using 'null' varaibles and checking whether they were 'null' each time we used them. If I understand correctly, the Null Object Pattern is actually about an object which implements default behavior in absence of something else. For instance, an implementation of an interface whose methods bodies are empty. The article is bad, but strangely it has excellent external links to flesh out a fair article. Ruijoel 13:06, 25 October 2007 (UTC)