Christopher Anabo
Christopher Anabo
Senior Tech Lead
Christopher Anabo

Notes

Proxy Design Pattern

Proxy Design Pattern

What is Proxy Design Pattern?

The Proxy Design Pattern is a design pattern in which the client and the actual object are connected by a proxy object. The client communicates with the proxy, which manages access to the real object, rather than the real object directly. Before sending the request to the real object, the proxy can take care of additional tasks like caching, security, logging, and lazy loading.

 

Proxy Design Pattern example (with implementation)

Problem Statement:

Consider a scenario where your application needs to load and display images, and you want to optimize the image loading process. Loading images from disk or other external sources can be resource-intensive, especially if the images are large or stored remotely.