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.
Which one of the following statements is not correct?
Various activities can be undertaken by the corporates under the CSR guidelines. Which of the following activities can be classified under the CSR activ...
Reinvestment risk would not occur if:
What will be the working capital if Cash & Bank Rs.20,000; Debtors Rs.2,00,000; Creditors Rs.1,00,000; Bills Payable Rs.50,000 and Stock is Rs.2,80,000.
Which of the following principle applies when Provision for Doubtful Debts is required to be maintained in the books of accounts?
The value stated on a bond certificate is called ______
A Public company should hold at least ______ meetings in a year.
XYZ Ltd reported total credit sales of Rs.12,80,000 at a gross profit margin of 15%. If the current ratio is 1.75 and inventory turnover of 4 times, wha...
What is the primary obligation of the trustee as per the Indian Trusts Act, 1882? Â
As per the recent (April 2024) change done to SGrBs, w hich of the following statements is NOT true about Foreign Institutional Investors (FIIs) investi...