O'Reilly logo

Design Patterns Java™ Workbook by 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

Remote Proxies

The idea of a proxy is that one object intelligently forwards calls to another object. This can become complex and fragile, as in the case of ImageIcon, where it is difficult to know which calls to forward. Even if you forward every call, your code may break if the class of the proxied object changes. When you encounter the PROXY pattern in a design, you should question whether the benefit justifies the accompanying fragility of code. There are cases in which applying PROXY is well justified, as when an object and its proxy are active on different computers.

If the object whose method you want to call is running on another computer, you must find a way to communicate with the remote object other than calling it directly. You could ...

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