Home
Contact us
Technology Skills
Comparisions
Interview Q & A
Management Skills
Free SMS Collection
Entertainment
Set as Homepage | Add to favorites


Bestest Blog of All- Time

Serialization in .NET

Serialization in .NET allows the programmer to take an instance of an object and convert it into a format that is easily transmittable over the network or even stored in a database or file system. This object will actually be an instance of a custom type, including any properties or fields you may have set.

For examples: Include the ability to send an instance of your object to another portion of a local or remote application, such as over a Web service. Another example of when to choose to serialize objects is for data within objects that would normally be stored in a database, but these pieces of data do not need to be stored individually (their own fields in your tables). Streamline the database design by only holding those pieces of data for each record you need to query on, and the rest of the pieces can simply be serialized within a custom type and stored as a complete object within the database.

Also at some point in time, application will likely need to persist this data structure to disk, minimally so that the user can close the application down and reopen it. Traditionally, we write some code that would go through the list of employees and add a record for each employee into a database. When we want to, we read the records from the database back into memory. In a sense, we serialized the data structure for each employee into a series of bytes in the database and then deserialized the bytes back into a data structure at a future time.