RSS Feed
Download our iPhone app
Browse DevX
Sign up for e-mail newsletters from DevX


Writing Advanced .NET Remoting Clients

.NET Remoting provides a powerful way to use remote objects as if they existed locally, using interfaces and the factory pattern.

The .NET framework has a number of powerful Remoting features to make working with remote objects simple especially in the client side code. You can use factory patterns to enable powerful features in the client side code. However, the client side code uses nothing more than ordinary interfaces.

Why not a Web Service?
Remoting provides a number of advantages over Web services but we can start with the way you use them. Web services are the equivalent of static function libraries. If the client creates an instance of the Web service and modifies a member variable of the object with one method call, then attempts to read the value from another method call, the value will be the default value for that variable, not the new value. That's because Web services don't maintain session state without considerable hacking outside of the SOAP standard. Therefore, when you need the ability to use remote objects, rather than remote methods, Remoting is the way to go.

Namespaces And DLLs used for Remoting
The namespaces used for Remoting in this article are, System.Runtime.Remoting, System.Runtime.Remoting.Channels, and System.Runtime.Remoting.Channels.Tcp. To use these namespaces in your own code, add a reference to the System.Runtime.Remoting.dll. To add the reference, select Project—> Add Reference from the VS.NET menu and then select the System.Runtime.Remoting.dll item from the list for the .NET tab.

Close Icon
Thanks for your registration, follow us on our social networks to keep up-to-date