Marshaling (from the English marshal - organize) in computer science is the process of converting information (data, binary representation of an object) stored in RAM into a format suitable for storage or transmission. The process is similar to serialization (see the differences below ). It is usually used when information (data, objects) must be transferred between different parts of one program or from one program to another.
The opposite process is called unmarshaling (similar to deserialization).
Content
Application
Marshaling is used when transferring data between processes and / or threads , for example:
- using various RPC mechanisms;
- when using P / Invoke on the .NET Framework (when switching from an unmanaged type to a CLR type);
- scripts and applications that use the XPCOM technology that ships with the Mozilla application framework (MFA) . The Mozilla Firefox browser is one of the most famous applications created using MFA. The use of MFA allowed scripting languages to use XPCOM technology through Cross-Platform Connect (XPConnect).
Comparison with serialization
In the Python standard library, the term “marshaling” is similar in meaning to the term “serialization” [1] , but the terms are not synonymous with RFC 2713 (“Schema for Representing Java (tm) Objects in an LDAP Directory”; October 1999) The Java language standard is based on:
To “marshal” an object means to record its state and code base (s) [2] (URI indicating the location of the object's class code for loading) so that the reverse operation produces a copy of the original, presumably by automatically loading the definition of the object's class . You can marshal any object that is serializable or remote (...). Marshaling is similar to serialization, except that when marshaling the location of the executable code is indicated. Marshaling differs from serialization in that marshaling is applied in a special way to remote objects for which a copy of the object itself is not created, but only a remote address is specified at which work with it should be performed.
Original textTo "marshal" an object means to record its state and codebase (s) in such a way that when the marshalled object is "unmarshalled," a copy of the original object is obtained, possibly by automatically loading the class definitions of the object. You can marshal any object that is serializable or remote (...). Marshalling is like serialization, except marshalling also records codebases. Marshalling is different from serialization in that marshalling treats remote objects specially. (...) marshalling records the remote object's "stub", instead of the remote object itself.- RFC 2713
“Serializing” an object means turning its state into a byte stream so that the specified stream can be converted back to a copy of the original object.
Original textTo "serialize" an object means to convert its state into a byte stream in such a way that the byte stream can be converted back into a copy of the object.- RFC 2713
Network Protocols
For computer networks, marshaling means the process of converting data into a format in which data can be transmitted over a network and can pass through network terminators. Data is converted into a byte stream, packed, divided into parts, transmitted over the network using the network protocol . Received data is converted back to the original format.
Notes
- ↑ Python Marshaling Module
- ↑ The code base here is not understood to be a commonly used value , but specific to Java - a set of URIs indicating the location of the remote executable code for interacting with the remote object
Links
See also
- Remote procedure call
- Serialization
- Mapping
- Microsoft's Component Object Model (COM)
- Common Object Request Broker Architecture (CORBA)