Question
Which design pattern is most suitable for controlling
access to a resource by limiting the number of clients that can use it concurrently?Solution
The Proxy Pattern is a structural design pattern used to control access to resources by acting as an intermediary or placeholder. It can implement restrictions like access control, caching, or logging. In the context of concurrency, the proxy ensures that only a limited number of clients access a resource at a time. For example, a proxy server can manage a pool of database connections, granting access to clients based on availability. This pattern reduces resource contention and improves system scalability and security. By isolating the resource, the Proxy Pattern adds flexibility and control over its usage. Why Other Options Are Incorrect :
- Singleton Pattern : Ensures a single instance of a class but does not control concurrent access.
- Factory Pattern : Focuses on object creation, unrelated to access control.
- Decorator Pattern : Enhances object functionality dynamically but does not manage access.
- Flyweight Pattern : Shares objects to save memory, not for controlling resource access.
Rural youth belonging to poor families are identified and trained for Self-employment in RSETIs. What does the “E” stand for in RSETIs?
Under the revised framework for hedging foreign exchange risk, what condition must be met by users taking positions beyond USD 100 million in contracts ...
Pradhan Mantri Jeevan Jyoti Bima Yojana is available to people in the age group of 18 to _________ years having a bank account who give their consent t...
Which of the following products of a bank can have credit risk?
A. fund based loans
B. non fund based loans
C. treasury products
When contrasting exchange-traded derivatives and over-the-counter derivatives, credit risks
The Securities and Exchange Board of India (Sebi) has mandated the registration of index providers managing "significant indices" based on securities li...
Systemic risk may arise due to ______
Which of the following is responsible for the implementation of the Solar Chakra Mission?
What is the wrong statement about NBFCs?
K Enterprises follows the written down value method of depreciating machinery year after year due to which of the following: