Details
-
Type:
Sub-task
-
Status:
Resolved
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: None
-
Fix Version/s: 1.1 - Concurrency
-
Component/s: None
-
Labels:None
-
Acceptance Test - Add?:No
Description
Currently, JID implements Externalizable. This interface defines two methods that are used for serialization of objects. The implementation of those methods assign a deserialized values to instance fields. This prevents those field from being defined 'final', which in turn prevents the class from being defined immutable.
We should consider dropping the Externalizable interface.
The Externalizable interface implementation could be moved into a structure as described in Josh Bloch's Effective Java, Second Edition as the Serialization Proxy Pattern. This would allow us to retain the way serialization is performed (through the pluggable ExternalizableUtil implementation, which introduces a performance boost in comparison with regular serialization through reflection), without the need for the methods defined by the Externalizable interface in JID.
http://lingpipe-blog.com/2009/08/10/serializing-immutable-singletons-serialization-proxy/