Proxy Design Pattern
Explore the proxy design pattern and its role in controlling access to sensitive or resource-intensive objects in software. Learn about different types of proxies such as virtual, protection, and remote, and understand how proxies act as intermediaries to manage object interaction, improving security and efficiency in your C++ designs.
We'll cover the following...
Overview
Suppose that we have a very sensitive object, and we don’t want the client to access it directly. Or, we have an object that is very expensive to create. We certainly want to limit access to the objects in these cases. This is where we would use the proxy pattern.
In the proxy pattern, we introduce a middleman (surrogate) that will interact with the real object. Through this proxy (surrogate), we can limit access to the original object. It will also help us hide the detail of the real objects from the client.
Type
The ...