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?s a Windows process?

1 Answers  


Where are shared assemblies stored?

4 Answers  


What is a formatter in .net remoting?

0 Answers  


What do you mean by windows authentication?

0 Answers  


Define proxy in .net remoting?

0 Answers  






Define singlecall activation mode in .net remoting?

0 Answers  


Choosing between HTTP and TCP for protocols and Binary and SOAP for formatters, what are the trade-offs? In what way it is best?

2 Answers  


What are dynamic assemblies?

0 Answers  


What are the threading types?

0 Answers  


What is unboxing?

0 Answers  


About sn.exe ?

2 Answers   MMTS, TCS,


What is the purpose of System.EnterpriseServices namespace ?

1 Answers   Digital GlobalSoft,


Categories