Ask Question
12 April, 02:57

Where might the Null Object pattern be useful?

+1
Answers (1)
  1. 12 April, 06:29
    0
    Answer: Null Object pattern be useful when the absence of an object can be encapsulated by other alternatives which does not have any have any effect.

    Explanation:

    public interface Rectangle {

    double area ();

    double surfaceare ();

    boolean isNull ();

    }

    In the code above we have a function for null object. So in the absence of an object we have encapsulated with a method of null which does not do anything. It simplifies the use of dependencies that can be undefined.

    In case of collaborator the NULL object pattern makes use of the existing collaboration instead of defining a new one.

    It also enable to abstract the handling of null objects from the client so that internal details of the program are not know to outsiders.
Know the Answer?
Not Sure About the Answer?
Get an answer to your question ✅ “Where might the Null Object pattern be useful? ...” in 📙 Computers & Technology if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers