What are the differences between Marshal by value and
Marshal by reference?

Answers were Sorted based on User's Feedback



What are the differences between Marshal by value and Marshal by reference?..

Answer / rashmi tiwari

Remoting makes an object in one process (the server)
available to code in another process (the client). This is
called marshalling, and there are two fundamentally
different ways to marshal an object

-->Marshal by value: the server creates a copy of the
object 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.

Is This Answer Correct ?    33 Yes 6 No

What are the differences between Marshal by value and Marshal by reference?..

Answer / j's

Marshal-by-value objects are copied by the remoting system
and passed in their entirety to the caller's application
domain. Once copied to the caller's application domain (by
the marshaling process), all method calls and property
accesses are executed entirely within that domain. The
entire object exists in the caller's domain, so there is no
need to marshal accesses across domain boundaries. Using
marshal-by-value objects can increase performance and
reduce network traffic when used for small objects or
objects to which you will be making many accesses. However,
because the object exists entirely in the caller's
application domain, no state changes to the object are
communicated to the originating application domain, or from
the originator back to the caller. Marshal-by-value is not
a good choice for very large objects with many accesses. It
makes little sense to marshal an entire large object across
domain boundaries when all you need is access to a single
field, method, or property.

Is This Answer Correct ?    31 Yes 8 No

What are the differences between Marshal by value and Marshal by reference?..

Answer / bolisettyvaas

MBV:the server creates a value and send it to the Client .
MBR:The Server sends the reference of that value to the Client.

Is This Answer Correct ?    15 Yes 2 No

What are the differences between Marshal by value and Marshal by reference?..

Answer / m.m.suhail

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.

Is This Answer Correct ?    15 Yes 4 No

Post New Answer

More Dot Net Remoting Interview Questions

What is the proxy of the server object in .net remoting?

0 Answers  


What is the difference between .Net Remoting and Web Services ?

1 Answers  


When should we choose .net remoting over .net web services?

0 Answers  


Define proxy in .net remoting?

0 Answers  


Explain how can you automatically generate interface for the remotable object in .net with microsoft tools?

0 Answers  






How to register a shared assembly ?

1 Answers   Digital GlobalSoft,


Which one is better WebService and Remoting ?

0 Answers   NA,


What are the security issues if we send a query from the application?

2 Answers   Microsoft, Timken,


Define delegates and events?

0 Answers  


What are the steps to publish an object outside the service domain

0 Answers  


Can we configure a .net remoting object via xml file?

0 Answers  


What is the difference between authentication and authorization ?

7 Answers   Digital GlobalSoft, Qatar University,


Categories