What Is Serialization

Serialization is the process of converting the state of an object into a form that can be persisted in a storage medium or transported across the processes/machines. The opposite of serialization is deserialization which is a process that converts the outcome of serialization into the original object. In computer science, in the context of data storage, serialization (or serialisation) is the process of translating data structures or object state into a format that can be stored (for example, in a file or memory buffer) or transmitted (for example, across a network connection link) and reconstructed later (possibly in a different computer environment). Serialization is the process of converting the state of an object into a form that can be persisted in a storage medium or transported across the processes/machines. The opposite of serialization is deserialization which is a process that converts the outcome of serialization into the original object. Jan 20, 2015  Serialization and the Drug Quality & Security Act The supply chain for genuine pharmaceuticals has grown longer, and every step in the chain offers an opportunity for counterfeiters. By Bikash Chatterjee, president and CTO, Pharmatech Associates. Jan 20, 2015.

Active1 month ago

I am getting started with OOP programming and would like to know what is the meaning of serialization in OOP parlance? Uno game rules in spanish.

Aniket Thakur
46k28 gold badges211 silver badges228 bronze badges
edward

14 Answers

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.

Andrew BarnettAndrew Barnett
3,7091 gold badge18 silver badges23 bronze badges

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 -

  1. XML: Convert Object to XML, transfer it over a network or store it in a file/db. Retrieve it and convert it back to the object with same state. In Java we use JAXB(Java architecture for XML binding) library.(From java 6 it comes bundled with JDK).
  2. JSON: Same can be done by converting the Object to JSON (JavaScript Object notation). Again there is GSON library that can be used for this.
  3. Or we can use the Serialization that is provided by the OOP language itself. For example, in Java you can serialize an Object my making it implement Serializable interface and writing to Object Stream.
TylerH
16.6k10 gold badges57 silver badges72 bronze badges
Aniket ThakurAniket Thakur
46k28 gold badges211 silver badges228 bronze badges

Explanation via Picture:

Explanation by Analogy:

Suppose I'm talking to my buddy on the phone and I'm telling him about my new puppy.

Here's my problem: the puppy is a living, breathing mammal. How am I meant to convey a puppy over the phone line? I can't physically put my puppy into my phone receiver.

So instead, I'll have to convey a representation of the puppy over the phone. In other words, I then serialize my dog Rex, and I send him the serialized version of Rex over the phone line:

{ 'name':'Rex', 'age':5, 'favourite_food': pedigree_choice_cuts, 'favourite_game': fetch_ball, 'favourite_hobby': wagging_tail }

It's a perfect representation - a serialization of my dog.

Summary:

Serialization basically means transforming my dog Rex into something else - a JSON object - which can then be transported over the phone line as a series of 1s and 0s. My buddy in NYC can then translate those 1s and 0s back into a JSON object - so that he has a perfect representation of my dog Rex. Simple! Any questions? Just post a comment.

BKSpurgeonBKSpurgeon
15.8k6 gold badges63 silver badges51 bronze badges

Check this out, this will give you a good explanation:

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.

Andy WhiteAndy White
60.4k46 gold badges165 silver badges202 bronze badges

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)

TylerH
16.6k10 gold badges57 silver badges72 bronze badges
Chamin WickramarathnaChamin Wickramarathna

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.

Dave SherohmanDave Sherohman
37.6k11 gold badges58 silver badges95 bronze badges

serialization is converting an object to storable bit sequence.

so you can save this sequence to a file, db or send over network.

later you can deserialize it to the actual object and reuse it whenever you want.

Web Services and AJAX is the most common example of serialization. The objects serialized before sending the response to the client.

CanavarCanavar
41.9k17 gold badges79 silver badges116 bronze badges

Maxtor driver download windows 10. serialization is nothing but transfering the java supported object to file supported form

converting java supported form to network supported form.the main scope of the serialization is nothing but to transfering the data from one layer to the another layer..only serialized objects we can send over the network.

What Is Serialization And Deserialization In Json

sriiiisriiii

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.

Nesan ManoNesan Mano
6651 gold badge6 silver badges19 bronze badges

Serialization is when object (a chunk of memory) translated in a form when object's state could be saved in file (as an example).

Just treat it as making cookies - object is a dough, cookie - is a serialized dough.

So by 'serializing' you can send cookie to your friend.

Something like that :-)

Mr.ElectroNickMr.ElectroNick

Serialization is turning data into a linear 'string' of bytes.

Others have said more or less the same thing, but I stress that computer models require that data fits in the one-dimensionally addressed RAM or persistent storage.

Most things that are 'data' are inherently serializable (even if you must reduce the abstract model to a linear one); not serializable are say a network connection or a complicated state-based machine like a parser.

OverflownOverflown
1,1002 gold badges14 silver badges25 bronze badges

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.

viswanathanviswanathan

When instantiating (constructing) the actual object(the thing) from a class (blueprint) there is a need to save the object (thing) by serializing it (breaking it down to its basic atomic structure) to a space in memory. (Kind of like Star Treks Transporter). You break the thing down into it stream of information that can be transported somewhere and stored. Then when you want to reconstruct the thing you just pull the atomically stored instance back into the object. Different from instaniation.

Asp Net What Is Serialization

David K HillDavid K Hill
Serialization

Serialization is the process of converting an object into binary data stream so that it can be stored in a file or send across a network where it can be resurrected back to the same object.

This document should help you understand Java serialization in detail.

Nikhil KatreNikhil Katre

protected by Aniket ThakurMay 11 '16 at 5:55

What Is Serialization And Deserialization

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).
Would you like to answer one of these unanswered questions instead?