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
Describe the roles of CLR in .NET Framework. CLR gives an environment to execute .NET applications on target machines. CLR is also a common runtime environment for all .NET cod

WDS and MDT Deployment Server Training Project Description: I'm seeking someone who can Teach/Train me with MDT and WDS server. This Can be online teaching courses. I will

How can you raise custom errors from stored procedure? The RAISERROR statements are  used to produce an ad hoc error message or to retrieve acustom message which is stored in t

Need Experienced Outlook (Microsoft Office) developer Your required skills: (1) A developer at heart, one that knows how to prepare modular, well-designed and clean code, (2) va

What are satellite assemblies? We use resource files to store data according to the localized languages. But when you actually go for the deployment you will not like to also i

Passport Authentication This is a centralized authentication service given by Microsoft that offers a single logon facility and membership services for participating sites. ASP

The costumer is an application that tracks production costuming, structure and other related pieces. We discussed this in detail and you have commentary and video to define the pro

What is the use of the Connection object? The Connection object is used to connect your application to a specific data source by giving the needed authentication information in

Connect a Software Application to a Database Backend Acquire the knowledge and develop the skills needed to prototype an end user application using a rapid application dev

I want a C# school project Project Description: The project is made in C# and haves a database connection. We have some small problems asking up data from the database.