O'Reilly logo

Component Development for the Java™ Platform by Stuart Dabbs Halloway

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

4.6. Abandoning Metadata

In all the scenarios discussed so far, class metadata is part of the serialization format. The first time an instance of a particular class is written, the class metadata is also written, including the class name, SUID, field names, and field types. When default serialization is used, the field names are discovered by reflection, and the SUID is calculated by taking an SHA-1 hash of the class metadata. When you override these behaviors by specifying serialVersionUID or serial-PersistentFields, you are not eliminating metadata. Instead, you are just taking explicit control of what the metadata looks like.

The serialization mechanism also provides several hooks that allow you to skip sending metadata at all. This section ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required