Marshalling and types of marshalling, DOT NET Programming

What is marshalling and types of marshalling?

The Marshaling is used when an object is converted so that it can be sent across the network or across the application domains. The Unmarshaling generates an object from the marshaled data. There are 2 ways to do the marshalling:-

1) Marshal-by-value (MBV) :- In this type of marshalling the object is serialized into the channel, and a copy of the object is generated on the other side of the network. The object which is to marshal is stored into the stream, and the stream is used to build a copy of the object on the another side with the unmarshalling sequence.

2) Marshaling-by-reference (MBR):- Here it creates a proxy on the client which  is used to communicate with the remote object. The marshaling sequence of a remote object creates an ObjRef instance which itself can be serialized across the network.

The Objects that are derived from "MarshalByRefObject" are always marshaled by the reference.

To marshal a remote object the static method RemotingServices.Marshal() is used.RemotingServices.Marshal() has following overloaded versions:-

public static ObjRef Marshal(MarshalByRefObject obj)

 public static ObjRef Marshal(MarshalByRefObject obj, string objUri)

 public static ObjRef Marshal(MarshalByRefObject obj, string objUri,Type requestedType)

The very First argument obj specifies the object to marshal. The objUri is the path which is stored within the marshaled object reference; it can be used to access the remote object. The requestedType is used to pass a different type of the object to the object reference. This is very useful if the client using the remote object shouldn't use the object class but an interface that the remote object class implements instead. In this scenario the interface is the requestedType which must be used for the marshaling.

Posted Date: 9/21/2012 8:26:22 AM | Location : United States







Related Discussions:- Marshalling and types of marshalling, Assignment Help, Ask Question on Marshalling and types of marshalling, Get Answer, Expert's Help, Marshalling and types of marshalling Discussions

Write discussion on Marshalling and types of marshalling
Your posts are moderated
Related Questions
Printing Triangles - C# Program I need program code for Printing Triangles in C#. Can anybody send me there ideas?

What is difference between data set and data reader? Some major differences between dataset and datareader are as folows :- 1) The DataReader gives forward-only and read-onl

Differences between Datagrid, Datalist and Repeater?   1. Datagrid has paging whereas Datalist doesnt. 2. Datalist has a property called repeat. Direction = vertical/horizon

What precautions we need to take while deploying satellite assemblies? When we distribute the assembly, the folder structure has to be very organized. The table below shows how

What is the significance of Finalize method in .NET? The .NET Garbage collector does atmost all clean up activity for your objects. But unmanaged resources (like - Windows API

I have the working code I''m using to print the SQL table right now. I just need code to print in reverse order.

What are wait handles? The Wait handles sends signals of a thread status from one thread to another thread. There are 3 kind of wait modes:- A)WaitOne. B)WaitAny. C)Wa

What is a delegate? A delegate is similar to a class that is used for storing the reference to a method and invoking that method at runtime, as needed. A delegate can hold the

What are the best practices while implementing globalization and localization? The best methods while developing international language support software are shown below:- 1)

I am looking individuals who have company experience working on Jquery and Microsoft Technology ( MVC 4.5 ), who will take live online session and provide training through Team Vie