1.

What is serialization?

Answer»

When we WANT to transport an object through network then we need to convert the object into a stream of BYTES. Serialization is a process to convert a COMPLEX objects into stream of bytes for storage (database, file, cache, etc) or transfer. Its main purpose is to save the state of an object.
De-serialization is the reverse process of creating an object from a stream of bytes to their original form.

Types of Serialization:

Serialization is of following types:

  • Binary Serialization
    In this process all the PUBLIC, private, read only MEMBERS are serialized and convert into stream of bytes. This is used when we want a complete conversion of our objects.
  • SOAP Serialization
    In this process only public members are converted into SOAP format. This is used in web services.
  • XML Serialization
    In this process only public members are converted into XML. This is a custom serialization. Required namespaces: System.Xml, System.Xml.Serialization.

Serialization is used in the following purposes:

  • To pass an object from on application to another
  • In SOAP based web services
  • To transfer data through cross platforms, cross devices


Discussion

No Comment Found