next up previous contents
Next: Composite Pattern: JUnit Testing Up: Patterns Previous: Snapshot Pattern: Persistent Objects   Contents

Remote Proxy Pattern: Distributed Objects [63]



$\bullet$ Problem: How to access a distributed object on the network as if the object was on the same computer?

$\bullet$ Solution: Remote Proxy Pattern

$\bullet$ Outline: The Proxy Pattern provides for external service by a proxy, or substitute, object. The Remote Proxy Pattern uses a Proxy with the same look-and-feel as a RealSubject located somewhere on the network. Both the Proxy and the RealSubject implement the same interface so as to have the same look-and-feel. A call to op1() on the Proxy results in a call to op1() across the network to the RealSubject.


\begin{picture}(310,245)(55,575)\thicklines
\put(255,575){\framebox (110,100)...
...80){\makebox(0,0)[lb]{\raisebox{0pt}[0pt][0pt]{\twlrm SubjectIF}}}
\end{picture}




\begin{picture}(305,40)(60,740)\thicklines
\put( 95,740){\framebox (90,40){}}...
...0)[lb]{\raisebox{0pt}[0pt][0pt]{\twlrm \underline{:RealSubject}}}}
\end{picture}

$\bullet$ Java's Remote Method Invocation (RMI) is the Remote Proxy Pattern

$\bullet$ The Proxy is called a ``stub''

$\bullet$ The RealSubject has a ``skeleton'' that talks across the network to the stub

$\bullet$ SEE CASE STUDY


next up previous contents
Next: Composite Pattern: JUnit Testing Up: Patterns Previous: Snapshot Pattern: Persistent Objects   Contents
Ted Billard 2006-09-26