O'Reilly logo

Design Patterns in Java™, Second Edition by William C. Wake, Steven John Metsker

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

11 Proxy

AN ORDINARY OBJECT does its own work in support of the public interface that it advertises. It can happen, though, that a legitimate object cannot live up to this ordinary responsibility. This may occur when an object takes a long time to load, when the object is running on another computer, or when you need to intercept messages to the object. In these cases, a proxy object can take the responsibility that a client expects and forward requests appropriately to an underlying target object.

The intent of the PROXY pattern is to control access to an object by providing a surrogate, or placeholder, for it.

A Classic Example: Image Proxies

A proxy object usually has an interface that is nearly identical to the interface of the ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required