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:
- 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?
- If we represent our data over the wire as
xml
orjson
, is this always referred to asmarshaling
/demarshaling
? - If the above bullets are true, then is there an advantage to one over the other?