Discussion Locked

Serializable vs. Externalizable

0 helpful
2 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

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:
http://nl.com.com/MiniFormHandler?brand=builder&subs_channel=bldr_front_door&list_id=e027&tag=fb

2 replies

by avia

Peter,
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,
Avi.

by jslarochelle

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.

This discussion is closed to new replies.