Click here to Skip to main content
15,888,018 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I google serializatio-it all says it is an process of converting object into its bits representation.but my question is that "objects are resides in memory in form of bit reprentation then why requird the separate process of serialization while remote transfes?"
Posted
Comments
Ed Nutting 6-Nov-12 13:27pm    
1) Because some of what is stored in memory for the object isn't needed.
2) To transfer between systems you may need to serialise to a different format (e.g. little endian / big endian integer conversion)
3) Because in high level languages you don't have direct access to the bits/bytes
4) Because you may want to bits/bytes to be in a human-readble format suring transfer e.g. XML

I am sure there are many other reasons, these are just a few brief ones...

Hope this helps,
Ed

1 solution

It's almost never a separate process. Serialization takes place in the process you put it in, and this is almost always the same process where you use the data in memory.

Moreover, in some sense, this is always the case. I'll explain why. Suppose you created a separate process to serialize/deserialize some data model to/from file/network... When you need to use it in some other process; and then you will find that the processes are well isolated and are executed in separate isolated memory spaces. What will you do in this case? You will need to communicate between these two processes, that is use some IPC (http://en.wikipedia.org/wiki/Inter-process_communication[^]). And what it could be? Same very serialization!

Are you getting the idea? Serialization in a separate process would make little to no sense.

—SA
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900