Saturday, 20 July 2019

UGC NET Computer Science July 2018 - II Question 17

Question 17
17. A software design pattern often used to restrict access to an object is :

Options:
  1. (1) adapter
  2. (2) decorator
  3. (3) delegation
  4. (4) proxy
Answer : (4) proxy

Explanation Question 17
  • Proxy Pattern → We need the ability to control the access to an object. The light objects are called proxies and they will instantiate those heavy objects when they are really need and by then we'll use some light objects instead.  Use of the proxy can simply be forwarding to the real object or to provide additional logic. A proxy is a Interface or wrapper or agent object. Proxy is being called by the client to access the real object serving behind the scenes. 
    Read more about - Proxy Pattern
  • Adapter → Match interface of different classes.
  • Decorator → Add responsibilities objects dynamically. Effectively in the instantiation process, object-creation patterns use delegation effectively to get the job done.
  • Delegation → In software engineering, the delegation pattern is an object-oriented design pattern that allows object composition to achieve the same code reuse as inheritance. In delegation, an object handles a request by delegating to a second object (the delegate). The delegate is a helper object, but with the original context.
From above definations we conclude that "Proxy is a software design pattern often used to restrict access to an object"

So, Option (4) is correct answer.

Similar Questions:

1. A design pattern used to enhance the functionality of an object is
(a) Adapter
(b) Decorator
(c) Delegation
(d) Proxy

2. A design pattern often used to restrict access to an object is
(a) Adapter
(b) Decorator
(c) Delegation
(d) Proxy

3. You have a class that accepts and returns values in British Imperial units (feet, miles, etc.), but you
need to use metric units. The design pattern that would best solve your problem is
(a) Adapter
(b) Decorator
(c) Delegation
(d) Proxy

Question Reference::https://courses.cs.washington.edu/courses/cse331/18sp/exams/cse331-12sp-final-sol.pdf

1 comment:

  1. JOSAA 2020 Process will be conducted after the JEE Advanced Exam. Basically Joint Seat Allocation Authority (JOSAA) is Counselling Conducting Body. Through JOSAA 2020 students will take admission in IITs, NITs, IIITs and many other centrally funded technical institutes. It was established by the Ministry of Human Resource Development (MHRD).Click here for more information

    ReplyDelete

UGC NET Computer Science December 2019 | Question 16

Question 16 In a certain coding language. 'AEIOU' is written as 'TNHDZ'. Using the same coding language. 'BFJPV' wil...

Popular Posts