Web Development

General discussion


Serializable vs. Externalizable

By MaryWeilage Editor ·
This week's Java e-newsletter compares the pros and cons of java.io.Externalizable and java.io.Serializable. The author also explains the key differences between serialization and externalization.

Based on your application's requirements, which one would you choose? What would make you choose one interface over the other? Let us know.

If you aren't subscribed to the free Java e-newsletter, click the following link to automatically sign up:

This conversation is currently closed to new comments.

Thread display: Collapse - | Expand +

All Comments

Collapse -

What about custom serialization?

by avia In reply to Serializable vs. External ...

You forgot to mention that any java class can customize java's default serialization mechanism by overriding the "readObject()" and "writeObject()" methods. Perhaps you'd care to fill in the rest of the details regarding this option?

Good Luck,

Collapse -

Implement Serializable judiciously

by jslarochelle In reply to Serializable vs. External ...

There are many additional reasons not to implement Serializable:

- Decreased flexibility to change a class's implementation
- Increased testing burden when modifying the class

See Joshua Bloch "Effective Java" for details about the inconvenient of implementing Serializable and many good tips about serialization.

Related Discussions

Related Forums