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
Question: (a) Give three key differences between the DetailsView and FormView controls. (b) The ASP.NET 2.0 Framework introduces the idea of validation groups. How Valida

I need Windows Phone App (WP 8 and above) I am seeking an app developer/designer to develop me a Windows Phone app. This will be an app where users will post questions in the

Explain the diffrent type of literals in c# The different types of literals in C# are: Boolean literals - Refers to the True and False literals that map to the true and fals

What I need is the following: I need an implementation in matlab under windows to open a named pipe and to read data from the pipe (an other program writes into the pipe) in quasi

What are the components of WF 4.0? WF having of various components that work together to make desired workflow. The components of WF are given as follows: Workflows and a

What is Windows DNA architecture? The Windows Distributed internet Applications Architecture (DNA) is a Microsoft blueprint for scalable, robust, & distributed business softwar

Briefly explain how the server control validation controls work? A validation control works by evaluating the value of an input server control on the page to see whether it mee

Define an array. An array is explained as a homogeneous collection of elements, stored at contiguous memory locations, which can be referred by the similar variable name. All t

Concept of Boxing and Unboxing The Boxing permits any value type to be implicitly converted to type object or to any other interface type implemented by the value type. The Box

Develop a scrapebox software Project Description: I need a software name scrapebox Skills required are .NET, C Programming, Java, C# Programming, Software Architecture