To serialize an object (which has <serializable()> tag declared) we have to use the IFormatter interface.
DotNet provides two classes for this purpose:
1) BinaryFormatter
2) SoapFormatter
both of them implement the IFormatter interface.
The BinaryFormatter is used to persist an object in binary form. this is used in most of the situations where portability is not an issue. BinaryFormatter is best used as it has good performance benifits and also the resulting bin file is smaller.
SoapFormatter is used in cases where the object has to persistant across different machines. Since the HTTP protocol best handles text data and also the XML is a standard used to transfer data, the object is persisted in XML format.
The major difference between these two is that BinaryFormatter saves all the member variables of a serializable class whereas SoapFormatter saves only the public member variables.
if u got any query feel free to contact me at