What is the difference between Serialization and Marshaling?

前端 未结 12 1605
忘了有多久
忘了有多久 2020-12-02 03:30

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\'

12条回答
  •  被撕碎了的回忆
    2020-12-02 04:03

    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.

提交回复
热议问题