E.1. The purpose of serialization

Serialization, like reflection, is a technique that is not all that widely used by Java developers. It is, however, an important part of most schemes that allow objects to be passed across a network. For example, serialization is often used to pass arguments to methods of objects in RMI systems. Understanding serialization is the key to understanding the rules on argument passing and return values in EJBs.

When an object is serialized, its complete state is converted into a stream of bytes that can be written and read in sequence. This byte sequence can be sent over a network, or written to a file, or passed as an argument to another method. A serialization scheme has to account not only for the instance variables ...

Get Applied Enterprise JavaBeans™ Technology now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.