CSC/ECE 517 Fall 2013/ch1 1w05 st

From Expertiza_Wiki
Revision as of 17:28, 17 September 2013 by Sramesh3 (talk | contribs) (Created page with "== '''Serialization''' == '''Serialization'''[http://en.wikipedia.org/wiki/Serialization] is the process of converting an object or a group of objects into a stream of bytes or...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Serialization

Serialization[1] is the process of converting an object or a group of objects into a stream of bytes or string to facilitate storage in memory or transmission over a network. The process of Serialization is also referred to as Marshalling. De-serialization is the process of converting the stream of bytes or string back to objects in memory. This process of de-serialization is also referred to as Unmarshalling.


Serialization in Ruby:

Let us consider a situation where two Ruby programs have to communicate with each other. One of the simplest way to do this is to convert the Ruby objects in the first programs into strings and writing these strings into a file. This is nothing but serialization. The second program can read this file and convert the strings back into Ruby objects. This is de-serialization.