While sending an object from a source to destination, an object will be converted into a binary/xml format. This process is called serialization .
After it is reached to destination, it will be converted back to original object. This process is called deserialization .
Serialization/deserialization will avoid problems like byte reordering,memory layout etc and gives better performance.
Byte Reordering :
Machines might be of type Big-Endian or Small-Endian. Depends on Endian type, most significant bytes will be stored in left-side or right-side. When an object traverse from One Endian machine to another Endian machine, these bytes needs to be reordered. By serializing/deserializing we are avoiding this.
Memory Layout :
Different programming languages might store the object in different ways. When the object is traversed,it needs to be stored in memory according to language architecture. By serializing/deserializing we can avoid this problem.
Asked In: Many Interviews |