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 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access