Name: rm29839 Date: 01/26/98
MT applications often need to make deep copies of
objects to be passed between threads. While Java
provides a way to make shallow copies using the
default implementation of Object.clone(), making
deep copies generally is very cumbersome and
sometimes even impossible. Currently the most
general way to achieve this is to serialize the
object and deserialize it again. This is
cumbersome, slow, and, worst of all, requires all
objects to be Serializable. The latter is
especially bad if you don't have the source code
to all classes you're using.
Replication of arbitrary data structures could be
implemented in a way simular to object
serialization, i.e. one could traverse the graph
the same way the ObjectOutputStream does, except
that each reached object would have to be cloned
instead of being written to some stream.
(Review ID: 23953)
======================================================================