CSC/ECE 517 Fall 2009/wiki2 18 ee: Difference between revisions

From Expertiza_Wiki
Jump to navigation Jump to search
No edit summary
 
Line 1: Line 1:
=Serialization Proxy Design Pattern=
=Serialization Proxy Design Pattern=
During system design, immutable classes are preferred to guarantee thread safety and consistent object state. For instance, serialization of immutable classes could cause issues in Java if immutability must be preserved. The Serialization Proxy Pattern aims to make serialization acceptable in that regard. Discuss serialization proxy pattern with regards to the problem, design, implementation details, and idiomatic usage.


==Introduction==
==Introduction==
When the need to serialize objects in Java arises, the most common tool is the Serializable interface.  This interface is simply used to indicate that the object is serializable.  The class may implement the writeReplace() method.  If it does, during serialization the object returned from this method will be used for serialization instead of the object itself.
==The Problem== 
One issue with serialization under Java is the need for serialization of immutable classes. 






http://lingpipe-blog.com/2009/08/10/serializing-immutable-singletons-serialization-proxy/


==Definitions==
==Definitions==

Revision as of 04:31, 8 October 2009

Serialization Proxy Design Pattern

During system design, immutable classes are preferred to guarantee thread safety and consistent object state. For instance, serialization of immutable classes could cause issues in Java if immutability must be preserved. The Serialization Proxy Pattern aims to make serialization acceptable in that regard. Discuss serialization proxy pattern with regards to the problem, design, implementation details, and idiomatic usage.


Introduction

When the need to serialize objects in Java arises, the most common tool is the Serializable interface. This interface is simply used to indicate that the object is serializable. The class may implement the writeReplace() method. If it does, during serialization the object returned from this method will be used for serialization instead of the object itself.

The Problem

One issue with serialization under Java is the need for serialization of immutable classes.



http://lingpipe-blog.com/2009/08/10/serializing-immutable-singletons-serialization-proxy/

Definitions

References