Serialization in Java - all layers required!
Archive - Originally posted on "The Horse's Mouth" - 2007-02-05 08:45:11 - Graham EllisIf you want to subject a delicate piece of equipment to an extreme of temperture for a prolonged period, it's no good just putting it in a box, even if that box CAN withstand the temperature extreme. No - you need to have piece of temperature tolerant equipment AND a tempertaure tolerant box if you're going to subject the combination to the extremes.
And so it is when you have a serialiazable object in Java. Not only must you declare that your class implements selializable but you must also ensure that any objects that it contains are also serializable.
If you can selialize an object, it means that you can save it to a file or a database of transmit it via a network, and you'll be able to reconstruct the object later on / at the other end - literally, you're turning the object into a serial stream of bytes.