Saturday, May 5, 2018

C# : What is Serialization

Serialization means saving the state of your object to secondary memory, such as a file.

Suppose you have a business layer where you have many classes to perform your business data.

Now suppose you want to test whether your business classes give the correct data out without verifying the result from the UI or from a database. Because it will take some time to process.

SO what you will you do my friend?

Here comes Serialization. You will serialize all your necessary business classes and save them into a text or XML file.

on your hard disk. So you can easily test your desired result by comparing your serialized saved data with.

your desired output data. You can say it is a little bit of autonomic unit testing performed by the developer.

There are three types of serialization:
  1. Binary serialization (Save your object data into binary format).
  2. Soap Serialization (Save your object data into binary format; mainly used in network related communication).
  3. XmlSerialization (Save your object data into an XML file).

No comments:

Post a Comment