Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

...and unmarshalling/deserializing? Wikipedia's explanation leaves me none-the-wiser! I'm a Java programmer, in case the terminology is used differently in different languages.

share|improve this question

2 Answers 2

up vote 11 down vote accepted

Semantics are important here:

Marshalling implies moving the data, it does not imply transforming the data from its native representation or storage. Java Objects can be Marshalled over the wire in their native representation.

Serializing implies transforming the data to some non-native intermediate representation. For example: transforming a Java Object to JSON or XML.

Of course, most systems that Marshal data, Serialize it some some non-native format before they transport it.

share|improve this answer
    
Thanks Jarrod - that's a nicely succinct explanation. –  spume May 30 '12 at 11:45

This question has been asked before, but on StackOverflow. Here is the link.

Quotation of the answer given by Jeffrey Hantin:

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.