by, 01-08-2012 at 12:33 PM (1494 Views)
Reading or writing an object is called serialization. It saves an object sate which can be restored at a later stage. Implement the java.io.Serializable interface to make a class serializable. This interface is also called marker interface. It supports object persistence to a file.
If you do not want to serialize an object then mark it as transient. Serialization can affect performance in following ways:
• Depends on reflection.
• Has an incredibly verbose data format.
• Is very easy to send surplus data.
If you want to send an object over network or want to save its state to a file then use it otherwise do not use it as it has performance issues.