Some time back I posted about .Net Remoting and its advantages compared to other methods. After that I continued into the overhead and optimization you should apply using remoting. However one thing I did not yet discuss. What different variations of remoting are available.
So lets do that this time round. Lets start with introducing you into the two basic methods that can be used. First of you have serialization. When breaking it down to the basics this works as follows:You send an object across the network, all data of this class is then passed to a serializer. Pending on what type of serialization you choose to use it then generates XML or binary data to send across the network. The second computer application receives this data and de-serializes it. This means you will have some overhead for every time you transfer information between the two applications.
The second method you will use is marshalling. This is somewhat similar to the JAVA rmi protocol. A marshalled object is one that does not actually send data to the receiving application. Instead a proxy-object is sent, this object contains all the information needed to call functions. As soon as you call any of the functions the proxy-object will contact the application that owns the object. This application will respond by returning data or applying business logic.
Now that you now the basic variants available you need to know when to use which one. This is actually very simple. You need a marshalled object to serve data that is serialized. Let me explain. Unless you can somehow place calls between applications you will not be able to send serialized data. So in order to send serialized data you need a marshalled object with some basic functions for sending and receiving objects.
To finish of lets go into some disadvantages of both of the methods. A serialized object has one huge downfall. If you change information on the client then this will not change on the server application. That means that you will have to manually synchronize the information between the two applications.
For marshalled objects the greatest downside is that every call to the object needs to be send across the network. This means that for every call you make the proxy-server prepares a network package, sends it, waits for a reply and decodes the reply. The downside is that it blocks the application until the call cycle is completed.