Wednesday, 16 April 2008

What is Serialization

Serialization is a technique which is implemented on any class to enable it to save it as on a storage medium.
Actually new bees get confuse in term of serialization and think it is something horrible. If we little bet see the work of sterilization technique we can easily understand that it only line by line all the item in the class and make the objects as same style and data size.
I am going to enplane it with an example

[Serializable]
public class myClass
{
string myName;
public string myNo;
}
this is an C and C# style class implementation

I we are going to save this class in buffer of by any method to our storage device then the Serializable class store the size in the memory.
if we assign the value to one variable or both but when we store the size will be same of the object, reason is that we serialize both.
This all process is only doing for when we get the data back from the storage the class can differentiate the variable in the class with the help of the size of object.