4. Chapter 4: Inter-process Communication
4.13. Java object serialization
Serialization (deserialization)
- The activity of flattening an object or a connected set of objects into a serial form that is suitable for storing on the disk or transmitting in a message
- Include information about the class of each object and a version number
- Handles: references to other objects are serialized as handles
- Each object is written once only
- Example (n1)
- Make use of Java serialization
- ObjectOutputStream.writeObject, ObjectInputStream.readObject
The use of reflection
- Reflection : The ability to enquire about the properties of a class, and also enables classes to be created from their properties.
- Reflection makes it possible to do serialization (deserialization) in a completely generic manner