Interviews World
 .Net (166)
 
  .Net Framework(43)
  .Net Memory Management(2)
  .Net Web Service(6)
  .Net Remoting(30)
  .Net Security(2)
  .Net Threading(8)
  .Net Architecture(2)
  Basic C#(33)
  VB.Net(2)
  .Net Window Service(3)
  .Net Window Forms(14)
  Advanced C#(25)
  Visual Studio 2003(2)
  Visual Studio 2005(2)
  Visual Studio 2008(2)
  Visual Studio 2010(2)
 
 ASP.Net (49)
 
  ASP.NET General(7)
  ASP.NET Caching(9)
  ASP.NET Ajax(13)
  ASP.NET Session(7)
  ASP.NET Localisation(2)
  ASP.NET 1.1(2)
  ASP.NET 2.0(2)
  ASP.NET 3.5(11)
  ASP.NET 4.0(2)
 
 Database (88)
 
  SQL Server 2000(20)
  SQL Server 2005(24)
  SQL Server 2008(42)
 
 ADO.Net (7)
 
  General ADO.NET(7)
 
 Object Oriented (27)
 
  Basic Object Oriented(19)
  Advanced Object Oriented(8)
 
 XML (24)
 
  Basic XML(24)
 
 MS Dynamics (1)
 
  MS Dynamics GP 9(2)
  MS Dynamics GP 10(1)
  MS Dynamics Soloman(2)
  MS Dynamics CRM 3.0(2)
  MS Dynamics CRM 4.0(2)
  MS Dynamics CRM 5.0(2)
 
 Sharepoint (65)
 
  Basic SharePoint(35)
  SharePoint Server 2003(4)
  SharePoint Server 2007(25)
  SharePoint Server 2010(2)
 
 HR (2)
 
  Basic HR(2)
 
 Java (1)
 
  Basic Java(1)
 
 PHP (2)
 
  Basic PHP(2)
 
 Testing (15)
 
  Automation Testing(15)
 
 
  Welcome to Interviews World
 

$5 .COM Black Friday Sale!


Question : What is marshalling and what are different kinds of marshalling ?

Answer :

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

 1-    Marshal-by-value (MBV) :- In this the object is serialized into the channel, and a copy of the object is created on the other side of the network. The object to marshal is stored into a stream, and the stream is used to build a copy of the object on the other side with the unmarshalling sequence.
 
2-    √ Marshaling-by-reference (MBR):- Here it creates a proxy on the client that is used to communicate with the remote object. The marshaling sequence of a remote object creates an ObjRef instance that itself can be serialized across the network. Objects that are derived from “MarshalByRefObject” are always marshaled by reference.All our previous samples have classes inherited from “MarshalByRefObject”
 
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 first argument obj specifies the object to marshal. The objUri is the path that is stored within the marshaled object reference; it can be used to access the remote object. The requestedType can be used to pass a different type of the object to the object reference. This is 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 that should be used for marshaling.
 
 
  Website Highlights
 




















 
 
 
  Newsleter
 
Enter your Email:
Newsletter