O'Reilly logo

Java™ Design Patterns: A Tutorial by James W. Cooper

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

Chapter 15. The Proxy Pattern

The Proxy pattern is used to represent with a simpler object an object that is complex or time-consuming to create. If creating an object is expensive in time or computer resources, a Proxy allows you to postpone this creation until you need the actual object. A Proxy usually has the same methods as the full object that it represents. Once that full object is loaded, the Proxy passes on the method calls to the full object.

There are several cases where a Proxy can be useful:

  1. If an object, such as a large image, takes a long time to load

  2. If the object is on a remote machine and loading it over the network might be slow, especially during peak network load periods

  3. If the object has limited access rights. The proxy can ...

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