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
I need Isometric Exploration Tablet Game I am endeavoring to build an 2D tile-based isometric game, primarily for Android and iOS tablet devices. It will be built in Unity 3d v4

What are value types and reference types?  Value type - bool, byte, chat, decimal, double, enum , float, int, long, sbyte, short, strut, uint, ulong, ushort. Value types are

I am seeking someone who can design customized software for me, preferably in .NET. I have a sql server backend which i would like to use so you only have to work with the front en

I need help to develop website using html5, responsive design and jquery.I need e commerce website flike alma meter and spreadshirtHours Skills required: .NET, HTML, Graphic

Modification in .net website I need some modification in asp.net website. It's an e-commerce site. Skills required: .NET, HTML, eCommerce, Shopping Carts, Website Design

What does Address Of operator do? The Address Of operator generates a delegate object for the BackgroundProcess method. A delegate within VB.NET is a object-oriented, type-safe

Why do we use the XMLHttpRequest object in AJAX? The XMLHttpRequest object is used by JavaScript to transfer XML and other text data among client and server. The XMLHttpRequest

What is a Web Service? The Web Services are the business logic components which provide the functionality via the Internet using standard protocols like HTTP. The Web Servic

The Events are always public as they are meant to serve each one registering to it. But you can access modifiers in the events.You may have events with protected keyword which will

What is the difference between int and int32. There is no difference among int and int32. System.Int32 is a .NET Class and int is an alias name for System.Int32.