What are the differences between Marshal by value and
Marshal by reference?
Answers were Sorted based on User's Feedback
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 |
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 |
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 |
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 |
How to register a shared assembly ?
Which namespace is used for encryption ?
When we use web service and when we use Remoting?
How can you configure a .net remoting object via xml file?
How can you tell the application to look for assemblies at the locations other than its own install?
Define remotable objects in .net remoting?
What are the difference between static assemblies and dynamic assemblies?
About remoting and web services. Difference between them?
What is fundamental of published or precreated objects in remoting?
What is boxing and unboxing ?
4 Answers Amdocs, BirlaSoft, TCS,
What are the information required to configure remote objects?
How can we call methods in remoting asynchronously?