views:

34

answers:

1

Hi,

I'm new in JSON, but now I need to use JSON for my Flash ActionScript 3.0. So I found one lib for JSON and I have seen the terms Deserialize & Serialize what does that means.

+2  A: 

JSON is a format that encodes objects in a string. Serialization means to convert an object into that string, and deserialization is its inverse operation.

When transmitting data or storing them in a file, the data are required to be byte strings, but complex objects are seldom in this format. Serialization can convert these complex objects into byte strings for such use. After the byte strings are transmitted, the receiver will have to recover the original object from the byte string. This is known as deserialization.

Say, you have an object

{foo: [1, 4, 7, 10], bar: "baz"}

serializing into JSON will convert it into a string:

'{"foo":[1,4,7,10],"bar":"baz"}'

which can be stored or sent through wire to anywhere. The receiver can then deserialize this string to get back the original object. {foo: [1, 4, 7, 10], bar: "baz"}.

KennyTM