Serializing objects
We've been working with bytes and file paths as foundations that support working with persistent objects. To make an object persistent, we need to create a series of bytes that represent the state of the object, and write those bytes to a file. The missing piece of persistence, then, is this process of encoding objects as a series of bytes. We also want to decode objects and their relationships from a series of bytes. This encoding and decoding is also described as serializing and deserializing.
When we look at web services, we'll often see a service described as RESTful. The "REST" concept is REpresentational State Transfer; the server and client will exchange representations of object states. The distinction here can be helpful: the two pieces of software don't exchange objects. The applications have their own internal objects; they exchange a representation of object state.
There are several ways to serialize objects. We...