Serialization and Deserialization

Serialization is a process of converting an object into a stream of data, to easily transfer over the network or to save to disk.   So, using this concept of serialization, we can serialize any object to XML string.
Here is a person class that we can serialize.


Here is the code that takes the person object into string of xml format.

Using Serialization in .NET is provided by the System.Runtim.Serialization name space.

Once you have the XML string, now you can save it to disk, store it into database, or transfer over the network.
Here is the deserialization method that takes serialized string of XML into the person object.

Kyoungsu Do
Software Quality Engineer
ImageSource, Inc. 

 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s