Abstract
This is the first in a series of tutorial columns that shall deal with specialized aspects of C# programming and the .NET framework.The .NET Remoting API is the equivalent of the Java Remote Method Invocation (RMI) API.Both frameworks allow objects on a client machine to communicate with remote objects on a server.To me, the infrastructure required in .NET appears simpler than in Java's RMI.What makes Remoting (or equivalently RMI) so attractive is that the low-level socket protocol that the programmer must normally manage is abstracted out.The programmer is able to operate at a much higher and simpler level of abstraction.In both languages there is some overhead in the form of boilerplate protocols that must be observed in order to setup the handshaking between the client and server machines.Once this is done, sending a message from a client machine to a server object uses the same syntax as sending a message to a local object.The metaphor of object-oriented programming remains central to this distributed programming.My last column presented a distributed solution to the Traveling Salesperson Problem (see this column in the Nov/Dec, 2003 issue of JOT) using Java's RMI.Although it is tempting to present a detailed and exhaustive presentation of .NET's distributed computing protocol, space does not permit this here.In this column, only an introduction and several simple examples of .NET Remoting using C# are presented.The namespaces that one typically uses in C# distributed object applications are the following:REMOTING IN C# AND .NET 84J OURNAL OF OBJECT TECHNOLOGY V OL. 3, NO. 1In C#, using distributed objects does not require stubs or interfaces as in Java.The CLR (common language runtime) provides full support for remote object calls.Using distributed objects does not depend on the system registry for information about the remote classes.This information is encapsulated in a .DLL file that must be added as a reference when compiling the client code.Classes derived from System.MarshalByRefObject cause the distributed object system to generate proxy objects on the client that encapsulate the low-level socket protocol.When the client sends a message to a remote object, it is the proxy that processes this message and sends serialized information across the network.The same works in reverse when proxy objects de-serialize information that is returned from the server.Channel objects are the mechanism used to transfer messages between client and server.The .NET framework provides two bidirectional channels:System.