4.1. Serialization and Metadata

Metadata plays two critical roles in serialization. First, serialization relies on class metadata and reflection to extract the state of an instance. In the common case, reflection does all the heavy lifting, and developers do not have to write any per-class serialization code. Unfortunately, the simplicity of basic serialization is deceptive. Java is designed to support dynamic, changing systems, which makes serialization more complex than it appears at first brush. In a dynamic system, it is possible for the receiver of a serialized object to not have the appropriate class. If this is the case, the receiver will need to know what sort of class loader it needs to create to access the class.

What is even worse ...

Get Component Development for the Java™ Platform now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.