Null Object Design PatternThe intent of a Null Object is to encapsulate the absence of an object by providing a substitutable alternative that offers suitable default do nothing behavior. In short, a design where "nothing will come of nothing" Use the Null Object pattern when an object requires a collaborator. The Null Object pattern does not introduce this collaboration--it makes use of a collaboration that already exists some collaborator instances should do nothing you want to abstract the handling of null away from the client. How to use this toolsConsider the following solution: And the following classes: Add a new item to the models folder: Search and select the template Null Object Pattern Generator After adding, classes are rewritten the tools generated the following classes
Now it's your turn!!! |