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.
In November 2020, the Board of Control for Cricket in India (BCCI) announced _____ as Team India's kit sponsor till 2023.
Who out of the following is a maestro of Santoor?
Ker and Garia Puja are traditional tribal festivals of which state?
Consider the following statements:
1. Akbar abolished Jizya, the tax on non-Muslims, in 1564.
2. The Mansabdari system, a grading of civil...
The National Forestry Action Plan identified which of the following interrelated basic issues confronting forestry development in India?
1. Prote...
The name of which chemical element of group 1 was discovered in 1817 from the Greek word meaning stone?
Safety fuse wire used in domestic electrical appliances is made of metal of low
Which of the following statement is/are INCORRECT about Nari Shakti Vandan Adhiniyam (Women's Reservation Bill)?
1. The lower house of Parliament...
According to a circular of 2020, by market regulator Sebi, open-ended debt mutual funds are required to hold at least what percentage of their corpus i...
For which category of individuals is a passport not available under the Tatkal scheme, which is specifically designed for expedited processing for urgen...