© Vaskaran Sarcar 2019
Vaskaran SarcarJava Design Patternshttps://doi.org/10.1007/978-1-4842-4078-6_6

6. Proxy Pattern

Vaskaran Sarcar1 
Bangalore, Karnataka, India

This chapter covers the proxy pattern.

GoF Definition

Provide a surrogate or placeholder for another object to control access to it.


A proxy is basically a substitute for an intended object. Access to the original object is not always possible due to many factors. For example, it is expensive to create, it is in need of being secured, it resides in a remote location, and so forth. The proxy design pattern helps us in similar contexts. When a client deals with a proxy object, it assumes that it is talking to the actual object. So, in this pattern, you may want to use a class that ...

Get Java Design Patterns: A Hands-On Experience with Real-World Examples now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.