views:

591

answers:

7

Hi

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

I am not a native english speaker hence the question.

+4  A: 

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.

Andy White
Not necessarily just XML, it can be any representation, even a binary representation
MatthieuF
+4  A: 

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 Barnett
A: 

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.ElectroNick
...except cookies can't be turned back into dough (deserialized).
Dave Sherohman
+1  A: 

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.

Canavar
A: 

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.

Overflown
A: 

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.

viswanathan
A: 

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 Sherohman