The Null Object template is a great tool for test-based development. If I need to make the behavior of the system more complex, I enter a null object to quickly return to green. In addition, often a null object is useful for preservation for old unit tests. More details and other uses of the null object template:
http://en.wikipedia.org/wiki/Null_Object_pattern
Now that I have several of them in the system, I begin to think about how to name them. As a rule, do you just put Null as the first word in the name or do you give each null object its own name?
Let me give an example for discussion. Say I only wore black turtlenecks, but now I want to change my wardrobe a bit. I will name my new type WardrobeChooser. To encapsulate the previous behavior, I could call my old object NullWardrobeChooser or BlackTurtleneckWardrobeChooser or even MissingWardrobeChooser (yikes!), Which may be bad). What name would you recommend?
I looked on the Internet, but I can not find any links about this.
source share