Lably
Skip to content

Marshalling (computer science)

Computer memory transformation process

  • 11 min read
  • 5 chapters

Related on Lably

Through Computer science, American and British English spelling differences and Object (computer science)

Marshalling simplifies complex communications, because it allows using composite objects instead of being restricted to primitive objects.

Comparison with serialization

Marshalling is sometimes used as synonymous with serializing, while serialization is actually one step in the process of marshalling an object.

  • Marshalling is describing the overall intent or process to transfer some live object from a client to a server (with client and server taken as abstract, mirrored concepts mapping to any matching ends of an arbitrary communication link ie. sockets). The point with marshalling an object is to have that object that is present in one running program be present in another running program; that is, an object on the client should be transferred to the server, which is a form of reification allowing the object’s structure, data and state to transit from a runtime to another, leveraging an intermediate, serialized, "dry" representation (which is of second importance) circulating onto the communication socket.
  • Serialization does not necessarily have this same intent, since it is only concerned about transforming data to generate that intermediate, "dry" representation of the object (for example, into a stream of bytes) which could then be either reified in a different runtime, or simply stored in a database, a file or in memory.

Marshalling and serialization might thus be done differently, although some form of serialization is usually used to do marshalling.

The term deserialization is somewhat similar to un-marshalling a dry object "on the server side", i.e., demarshalling (or unmarshalling) to get a live object back: the serialized object is transformed into an internal data structure, i.e., a live object within the target runtime. It usually corresponds to the exact inverse process of marshalling, although sometimes both ends of the process trigger specific business logic.

The accurate definition of marshalling differs across programming languages such as Python, Java, and .NET, and in some contexts, is used interchangeably with serialization.

Sign in to keep reading

4 more chapters are free with a Lably account.

More in Computing and communication