1

I've seen several posts and topics regarding marshaling and serialization and I'm looking to gain some additional understanding/clarify my thought process.

I read What is the difference between Serialization and Marshaling? and a lot of the responses show that they are synonymy in a sense. But I think there may be some differences which I'm trying to clarify.

My understanding is that java serialization takes an object and makes it into a binary stream which can then be deserialized, as shown in the following example http://www.tutorialspoint.com/java/java_serialization.htm

For marshaling/demarshaling, I've seen classes get converted into an xml representation of the bean and have the information passed between a client and server, then recreated on the other end.

Based on the above my question(s) are:

  1. Does serialization always go to binary format? If so, do we have to worry about different machine architectures like Big Indian vs. Little Indian or does java handle this for us?
  2. If we represent our data over the wire as xml or json, is this always referred to as marshaling/demarshaling?
  3. If the above bullets are true, then is there an advantage to one over the other?
Community
  • 1
  • 1
James Oravec
  • 19,579
  • 27
  • 94
  • 160

1 Answers1

0

I think it is just a matter of taste and context. Most times I encounter the term either of the terms means that you want to turn an object into a string of 0 and 1. But sometimes a specification might attach a slightly different meaning to it.

See the java case on wikipedia. http://en.wikipedia.org/wiki/Marshalling_(computer_science)

Nils
  • 1,750
  • 14
  • 10