Proxies in Remoting

When your .NET routines call out to a remote function, they do so through the use of a local version of that function, which is known as a proxy. A proxy is a hollow ghost image of the object located on the remote server, which appears locally to the calling function. It is the proxy's job to reroute that function call to the remote object, and then receive that object's response and present the results to the caller. Chapter 8 covers proxies within the discussion of XML Web services.

In Remoting, there are two levels of proxies. The top-level proxy that the calling client object deals with is known as a TransparentProxy. As the name implies, this is a very thin, see-through proxy class that acts as the intermediary to RealProxy class. It should come as no surprise that all of the real proxy work is done in the RealProxy class. The TransparentProxy handles all of the client object interaction and basic data packaging, whereas the RealProxy class handles the bulk of the work, including communications with the server object. You can see where the TransparentProxy and RealProxy fit in the communications between the client and server objects by looking at Figure 13.3. Developers wanting to enhance the role of the Remoting proxy object can extend and customize the TransparentProxy class.

Figure 13.3: Proxy classes in a Remoting client-server session.
0 0

Post a comment