Serialization is the process of turning an object in memory into a stream of bytes so you can do stuff like store it on disk or send it over the network.
Deserialization is the reverse process: turning a stream of bytes into an object in memory.
Simply speaking Serialization is a process of converting an Object into stream of bytes so that it can be transferred over a network or stored in a persistent storage.
Deserialization is the exact opposite - Fetch a stream of bytes from network or persistence storage and convert it back to the Object with the same state.
The thing to understand is how those stream of bytes are interpreted or manipulated so that we get the exact same Object/ same state. There are various ways to achieve that. Some of them are -
Serializable interface
and writing to Object Stream.Serialization means transforming something (e.g. my dog Rex) into a series of 1s and 0s - which can be transported over the phone line, stored in memory. My friends overseas can then translate those 1s and 0s back into a perfect representation of a puppy (de-serialization) so they can enjoy Rex's company.
Friends, this is an analogy. I don't think you can actually serialise a puppy LOL. You would serialise a data structure, or some other complex object. (I wrote this answer so you can understand the concept, in a fun way, in less than 10 seconds, without breaking your head against a technical encyclopedic definition. But if you prefer one please check out: this Wikipedia link).
Check this out, this will give you a good explanation:
http://en.wikipedia.org/wiki/Serialization
I think the most common use of the term serialization has to do with converting a binary object into an XML (or other string) representation so that it can be stored in a database/file or sent across a network in a web service call. Deserialization is the reverse process - converting an XML/string back into an object.
EDIT: Another term you might come across is marshalling/unmarshalling. Marshalling is basically the same concept as serializing, and unmarshalling is the same as deserializing.
Serialization is the process of converting an object into a stream of bytes to store the object or transmit it to memory, a database, or a file. Its main purpose is to save the state of an object in order to be able to recreate it when needed. The reverse process is called deserialization.
...
This illustration shows the overall process of serialization
...
Through serialization, a developer can perform actions like sending the object to a remote application by means of a Web Service, passing an object from one domain to another, passing an object through a firewall as an XML string, or maintaining security or user-specific information across applications
From https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/concepts/serialization/
(emphasis mine)
Serialization is the process of converting unordered data (such as an object) into a series of tokens which can be used later to reconstruct the original data. The serialized form is most often a string of text, but doesn't have to be.
Serialization is the process of converting a Java,C# or any other (OOP languages) supported object to a transportable form. This way it be transported over the network or stored on a disk. For a class to be serializable, it must implement serializable interface.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With