Categories:
.NET (357)
C (330)
C++ (183)
CSS (84)
DBA (2)
General (7)
HTML (4)
Java (574)
JavaScript (106)
JSP (66)
Oracle (114)
Perl (46)
Perl (1)
PHP (1)
PL/SQL (1)
RSS (51)
Software QA (13)
SQL Server (1)
Windows (1)
XHTML (173)
Other Resources:
What is marshalling and what are different kinds of marshalling
What is marshalling and what are different kinds of marshalling ?
✍: Guest
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 :-
ã 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.
ã 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.
2007-10-23, 5473👍, 0💬
Popular Posts:
How do you open an SSH connection to a remote box? ????
How do we generate strong names ? or What is use the of SN.EXE ? or How do we apply strong names to ...
What is thread? A thread is an independent path of execution in a system.
What will be printed as the result of the operation below: main() { int a=0; if (a==0) printf("Cisco...
Explain in detail the fundamental of connection pooling? When a connection is opened first time a co...