Ask Question
26 March, 22:53

Where might the Null Object pattern be useful?

+2
Answers (1)
  1. 27 March, 01:08
    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?
Find an answer to your question ✅ “Where might the Null Object pattern be useful? ...” in 📘 Computers and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers