What is serialization in c#?
What is serialization in c# and how it is used?Also give the example of Binary Format serialization,Xml Foemat and Soap Format serialization?
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Satyapriya NayakPosted May 10, 2012, 1:38 PM
Serialization is the process of converting an object into a stream of bytes. Deserialization is the opposite process of creating an object from a stream of bytes. Serialization/Deserialization is mostly used to transport objects (e.g. during remoting), or to persist objects (e.g. to a file or database).Serialization can be defined as the process of storing the state of an object to a storage medium. During this process, the public and private fields of the object and the name of the class, including the assembly containing the class, are converted to a stream of bytes, which is then written to a data stream. When the object is subsequently deserialized, an exact clone of the original object is created.
Binary serialization preserves type fidelity, which is useful for preserving the state of an object between different invocations of an application. For example, you can share an object between different applications by serializing it to the clipboard. You can serialize an object to a stream, disk, memory, over the network, and so forth. Remoting uses serialization to pass objects "by value" from one computer or application domain to another.
XML serialization serializes only public properties and fields and does not preserve type fidelity. This is useful when you want to provide or consume data without restricting the application that uses the data. Because XML is an open standard, it is an attractive choice for sharing data across the Web. SOAP is an open standard, which makes it an attractive choice. There are two separate mechanisms provided by the .NET class library - XmlSerializer and SoapFormatter/BinaryFormatter. Microsoft uses XmlSerializer for Web Services, and uses SoapFormatter/BinaryFormatter for remoting. Both are available for use in your own code.Also Please refer Our recommended articles
Thanks
MuthuMari MPosted May 10, 2012, 11:09 AM
Serialization is the process of converting complex objects into stream of bytes for storage.
pls refer this url
http://www.c-sharpcorner.com/interviews/answer/499/
thanks.
If this post is useful then mark it as "Accepted Answer"
SenthilkumarPosted May 10, 2012, 7:28 AM
Serialization is a process of converting an object into a stream of data so that it can be is easily transmittable over the network or can be continued in a persistent storage location.
Please refer this article for examples,
http://www.codeguru.com/csharp/.net/net_framework/article.php/c19541/Serialization-in-the-NET-Framework.htm
http://aspalliance.com/983_Introducing_Serialization_in_NET.all