How Does Serialization Work?
Figure 20 shows how serialization typically works in a distributed application:
1. You stream an object to a portable format.
2. You pass the portable format between processes.
3. You have the receiving process stream the object from the portable format back into an instance of the original C++ class.
In this example, a client downloads data from a server. The portable format used is a compact object stream, which lets you reconstruct the serialized objects.
Figure 20 – Passing an object by value in a distributed application
Both the server and the client maintain classes that encapsulate data and functionality. The original object’s data is transferred to the client and used to create a copy. In effect, the object is passed between processes by value. After the transfer, the sender and receiver side each own an object of that class.