Wednesday 8 July 2015

Serializable vs Externalization in Java

1. In case of Serializable, default serialization process is used while in case of Externalizable custom Serialization process is used which is implemented by application.

2. JVM gives call back to readExternel() and writeExternal() of java.io.Externalizalbe interface for restoring and writing objects into persistence.

3. Externalizable interface provides complete control of serialization process to application.

4. readExternal() and writeExternal() supersede any specific implementation of writeObject and readObject methods.

Though Externalizable provides complete control, it also presents challenges to serialize super type state and take care of default values in case of transient variable and static variables in Java.

If used correctly Externalizable interface can improve performance of serialization process.


No comments:

Post a Comment

Related Posts Plugin for WordPress, Blogger...