A software design pattern often used to restrict access to an object is:
Pick an option to check yourself, or open the answer below.
Show answer & explanation
Correct answer: D. proxy
Explanation
The answer is proxy. A proxy provides a surrogate or placeholder that stands in for another object and controls access to it, which is exactly what a protection proxy, a virtual proxy or a remote proxy does. The adapter pattern converts one interface into another so that incompatible classes can work together, and the decorator pattern attaches extra responsibilities to an object at run time without changing its interface, so neither is about restricting access. Delegation is a general technique of forwarding a request to a helper object, not a GoF pattern for access control.More Programming Languages and Computer Graphics questions
- Consider the following statements regarding software architecture: S1: Coupling is a measure of how well the things grouped together in a m…
- A software design pattern used to enhance the functionality of an object at run-time is:
- Module design is used to maximize cohesion and minimize coupling. Which of the following is the key to implement this rule?
- The design concept 'Refinement' is a:
- A software design is highly modular if:
- Cohesion is an extension of: