What is the difference between Serialization and Marshaling?

I know that in terms of several distributed techniques (such as RPC), the term “Marshaling” is used but don’t understand how it differs from Serialization. Aren’t they both transforming objects into series of bits?

Related:

What is Serialization?

What is Object Marshalling?

13 s
13

Marshaling and serialization are loosely synonymous in the context of remote procedure call, but semantically different as a matter of intent.

In particular, marshaling is about getting parameters from here to there, while serialization is about copying structured data to or from a primitive form such as a byte stream. In this sense, serialization is one means to perform marshaling, usually implementing pass-by-value semantics.

It is also possible for an object to be marshaled by reference, in which case the data “on the wire” is simply location information for the original object. However, such an object may still be amenable to value serialization.

As @Bill mentions, there may be additional metadata such as code base location or even object implementation code.

Leave a Comment