Introducing Serialization in .NET
page 2 of 14
by Joydip Kanjilal
Average Rating: 
Views (Total / Last 10 Days): 72862/ 212

What is Serialization and De-serialization?

Serialization is the process of saving the state of an object in a persistent storage media by converting the object to a linear stream of bytes.  The object can be persisted to a file, a database or even in the memory.  The reverse process of serialization is known as de-serialization and enables us to re-construct the object from the previously serialized instance of the same in the persistent or non-persistent storage media.

Serialization in .NET is provided by the System.Runtime.Serialization namespace.  This namespace contains an interface called IFormatter which in turn contains the methods Serialize and De-serialize that can be used to save and load data to and from a stream.  In order to implement serialization in .NET, we basically require a stream and a formatter.  While the stream acts as a container for the serialized object(s), the formatter is used to serialize these objects onto the stream.

The basic advantage of serialization is the ability of an object to be serialized into a persistent or a non-persistent storage media and then reconstructing the same object if required at a later point of time by de-serializing the object.  Remoting and Web Services depend heavily on Serialization and De-serialization.  Refer to the figure below.

Figure 1

The above figure illustrates that the serialized object is independent of the storage media, i.e., it can be a database, a file or even the main memory of the system.

View Entire Article

User Comments

Title: Really Very Good, and easy to understand Article   
Name: Ved Prakash
Date: 2006-12-29 6:24:11 AM
Really Very Good, and easy to understand Article
Date: 2006-12-27 7:30:09 AM
Title: Good Article   
Name: santosh
Date: 2006-12-08 1:50:03 AM
Very nice one for those who doen't have much idea about serilazation. Basiaclly it is giving fair introduction.
Title: Good. Need Help   
Name: Nandhini.S
Date: 2006-11-10 6:21:53 AM
This is very good for the starters to begin serialization. But im having doubt in Hoe to store a comple Windows ,Form object in XML document to reconstruct later.
Title: Fabulous! Good job   
Name: Mohammed Abrar
Date: 2006-11-07 2:07:16 AM
This is a fantastic article about Serialization.
Special thanks to the author Joydip Kanjilal
Title: Excellent!   
Name: Peter Royle
Date: 2006-10-17 5:51:07 AM
The best article I've seen for someone who knows nothing about serialisation (sic).
Title: Great Yaar   
Name: Rangarajan
Date: 2006-10-11 7:28:52 AM
Great explanation.. Simple and subtle, understandable and staright forward..
Title: Thank you for your contribution!   
Name: Mamiow
Date: 2006-10-11 12:30:50 AM
Very good and understanding article.
Title: best of one   
Name: Mukesh
Date: 2006-10-09 11:24:54 AM
Very nice article....

Title: What about Performance   
Name: Satyadev Singh
Date: 2006-10-09 3:22:28 AM
Hi, This is really a excellent article, however I have some concern regarding the CPU performance when we are going to use SOAP formatter, because in my previous project I used Binary formatter and got CPU uses increased.
That's why I am scared about the CPU performance because in that particuler apps will have 1 hit per second.

You can reach me at singhsatyadev[*at*]gmail[#dot#]com

Title: Nice Article   
Name: ArunKumar P
Date: 2006-10-09 3:02:15 AM
It is useful for Beginner's
Title: GIS Architect   
Name: Naren Ranganathan
Date: 2006-10-07 6:48:58 PM
Great article on Serialization for newbies.
Title: Diff bet SOAP Formatter & Binary Formatter & XML Formatter   
Name: Jitendra C
Date: 2006-10-03 7:27:51 AM
Great!It gives a broad picture of Serialization.I wanted to know more on Difference between SOAP Formatter & Binary Formatter & XML Formatter
Title: need details   
Name: Haroon
Date: 2006-09-29 1:46:27 AM
this article is good. but what if we want to know that which .net types (e.g SQL types for .net like SQLBoolean and e.t.c.., that are not serializable) are serializable.
I would appreciate if you can provide list of the types that are not serializable in .net
Title: Good for starters   
Name: Sandeep Gulati
Date: 2006-09-25 1:55:25 PM
A good articles for starters.
Title: gr8 article   
Name: abhi_viking
Date: 2006-09-25 7:29:02 AM
really useful 1
Title: Very useful   
Name: BT
Date: 2006-09-23 11:29:27 PM
Very nice article but I'm still left to wonder which of the serilization methods described above is the best one to use (most widely used in the field).
Title: Simple but most Effective   
Name: Mazher Yasin
Date: 2006-09-21 2:15:44 AM
Greate Effort
Title: Superb   
Name: Amin
Date: 2006-09-13 2:58:59 PM
10 out of 10
Title: Very Good Introduction   
Name: Bharat Sisodiya
Date: 2006-09-12 8:20:29 AM
Very good Information for Starters
Title: Great Article   
Name: Michelle
Date: 2006-09-06 3:53:20 PM
Great article - good information!

Community Advice: ASP | SQL | XML | Regular Expressions | Windows

©Copyright 1998-2024  |  Page Processed at 2024-05-29 8:34:51 AM  AspAlliance Recent Articles RSS Feed
About ASPAlliance | Newsgroups | Advertise | Authors | Email Lists | Feedback | Link To Us | Privacy | Search