Java Reference
In-Depth Information
CHALLENGE 11.4
Figure 11.6 shows the getApogee() call being forwarded. The rightmost object
appears in a bold outline, indicating that it is active outside the
ShowRocketClient program. Fill in the class names of the unlabeled objects in
this figure.
Figure 11.6. When completed, this diagram will show the flow of messages in
an RMI-based distributed application.
The benefit of RMI is that it lets client programs interact with a local object that is a proxy for
a remote object. You define the interface for the object that you want clients and servers to
share. RMI supplies the communication mechanics and isolates both server and client from
the knowledge that two implementations of Rocket are collaborating to provide nearly
seamless interprocess communication.
Summary
Implementations of the P ROXY pattern establish a placeholder object that manages access to a
target object. A proxy object can isolate clients from shifts in state of a desired object, as
when loading an image endures a discernible duration. The problem with P ROXY is that by its
nature, it relies on a tight coupling between the placeholder and the proxied object.
Nowhere is this coupling more justified than in remote computing. Here, the P ROXY pattern
represents the ideal form of intercomputer communication. Rather than relying on another
protocol, distributed computing schemes, such as RMI, establish communication with remote
objects as normal-looking method calls. This lets a client communicate with a remote object
through a proxy as if the remote object were local. The role of P ROXY in distributed
computing appears to be a permanent advance in object-oriented computing.
Search WWH ::




Custom Search