Click here to Skip to main content
15,906,243 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
what is main difference between Marshal by value and Marshal by ref in .net remoting?
Posted

MBV:In this Server Creates a exact Copy of the Object and
sends it to the Client.Which can be used by the Client with
in its AppDomain with out making any further calls to the
server.
But this has a drawback,the copy sent to client will be
static and will not reflect the subsequent changes.So its
better not to use MBV when there are constant updates.

MBR:DotNet Framework creates a Proxy on the Client
AppDomain which the client uses for accessing the Objects
on the Server.We need to extend 'MarshalByRefObject' for
this.
But this to has a drawback,it increases the network traffic
as there can ba number of accesses to the Server.

So its depends upon our requirement.Small objects with
frequent accesses,we can go with MBR and huge Objects with
relatively low accesses we can go with MBV.
 
Share this answer
 
To be precise:

Marshal by value: The server creates a copy of the
object and passes the copy to the client.


Marshal by reference: the client creates a proxy for the
object and then uses the proxy to access the object.

Check THIS[^] for more details.

NOTE: Please use google first before posting your question here!


hope it helps :)
 
Share this answer
 
v3
Comments
Mehdi Gholam 22-Sep-11 11:24am    
my 5!
Uday P.Singh 22-Sep-11 12:22pm    
thanks :)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900