Tuesday, February 02, 2010

.Net Remoting Made Easy

   The subject of .net remoting can be very complex. There are several different ways you can do remoting; you can marshall by value or by reference, you can use server-side activation or client-side activation. You can choose SingleCall or Singleton instantiation, among others. You can use either of the default protocols (tcp or http) or you can use a custom protocol.

In this article I’m going to attempt to give you, the reader, the most “bang for your buck”. In other words, I’m going to use a configuration which I believe addresses the majority of situations you are likely to encounter, and I’m going to strip away everything that’s unnecessary for this configuration. (It’s sort of an 80/20 thing, if you change 80/20 to about 90/10.)

The scenario we’ll look at is one where we marshall by reference, use server-side activation, and Singleton instantiation. The implementation I use will work equally well for either TCP or HTTP protocols. In addition, I’ll show you how to make everything configurable so that you can change either the client implementation or the server implementation on the fly, without having to change any code or recompile.

This article is meant to be a quick tutorial to get you up and running quickly. I’m not going to go into any lengthy explanations about what remoting is, or when and why you should use it other than to say that its best used when you need to communicate internally behind your firewall, between applications/servers hosted on the same platform. In other words, you can’t use .net remoting to communicate between a .net application and a java application, or over the internet. If you want more in depth information in that regard, there’s a ton of it on Microsoft’s web site.

Read more: Murray Hill Technologies

Posted via email from jasper22's posterous