In my application, I have to instantiate many different types of objects. Each type contains some fields and needs to be added to a containing type. How can I do this in an
I just provide this answer because it was mentioned in a comment and I think it should also be a part of this enumeration of Design Patterns.
Intent
The 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
Here you find the full part of "Null Object" Design Pattern