Using Serialization over piped streams I believe I can perform deep copy (cloning).
Is this correct? Here is a code snippet:
Twisting together piped streams in the same
thread is prone to deadlock as per javadoc.
But that aside, "cloneObj" is a clone of "originalObj" in 100% everyway, right?
Should this be considered a valid technique in production code? If not, why not?
A senior developer informed me that the fathers of
Java intended serialization to only be used to persist an object outside the jvm. Using the twisted pipes technique was wrong because it violates the "intended use" of serialization and he refused to discuss any further.
What says the Java Ranch? Serialization is deep copy. Clone is deep copy. I can serialize to perform cloning. right?