II.1Data serialization
Roberto Bifulco — Mon, 02/11/2008 - 15:06
The biggest feature of AJAX is the possibility to fetch simple data that page's scripts organize for the presentation, cutting all the overhead linked to the formatting information that are embedded in HTML texts. Moreover, if the future is the building of rich client applications, the requested informations are not text, but a mix of different formats like numbers, strings, dates, and so on.
For this reason a serialization language is needed. In the beginning the serialization language was XML, and it is widely used yet. While XML is a great meta-language, it has two big downsides:
the great number of meta-information characters that in a small request could overcame the real information characters;
the need to implement an XML parser through Javascript, that as every interpreted language, pay a huge price in terms of elaboration time and resource usage.
These downsides are enough to search a new serialization language that actually is the JSON language.
“JSON (JavaScript Object Notation) is a lightweight data-interchange format. It is easy for humans to read and write. It is easy for machines to parse and generate. It is based on a subset of the JavaScript Programming Language, Standard ECMA-262 3rd Edition - December 1999. JSON is a text format that is completely language independent but uses conventions that are familiar to programmers of the C-family of languages, including C, C++, C#, Java, JavaScript, Perl, Python, and many others”[10].
The great advantage of JSON is that uses a subset of the Javascript language, in particular, JSON share the Javascript data structure representation. This means that the parsing of a JSON string can be done through the native-language written Javascript browser's parser, with a really high performance.
Some of the most famous AJAX applications use JSON for data serialization, an example are the already mentioned Gmail and Documents&SpreadSheets, but also Yahoo groups and others.
An example of JSON encoded text is the next:
{"widget": {
"debug": "on",
"window": {
"title": "Sample Konfabulator Widget",
"name": "main_window",
"width": 500,
"height": 500
},
"image": {
"src": "Images/Sun.png",
"name": "sun1",
"hOffset": 250,
"vOffset": 250,
"alignment": "center"
},
"text": {
"data": "Click Here",
"size": 36,
"style": "bold",
"name": "text1",
"hOffset": 250,
"vOffset": 100,
"alignment": "center",
"onMouseUp": "sun1.opacity = (sun1.opacity / 100) * 90;"
}
}} The same text expressed as XML:
<widget>
<debug>on</debug>
<window title="Sample Konfabulator Widget">
<name>main_window</name>
<width>500</width>
<height>500</height>
</window>
<image src="Images/Sun.png" name="sun1">
<hOffset>250</hOffset>
<vOffset>250</vOffset>
<alignment>center</alignment>
</image>
<text data="Click Here" size="36" style="bold">
<name>text1</name>
<hOffset>250</hOffset>
<vOffset>100</vOffset>
<alignment>center</alignment>
<onMouseUp>
sun1.opacity = (sun1.opacity / 100) * 90;
</onMouseUp>
</text>
</widget>Other examples are in http://www.json.org/example.html .


nfl jerseys suppliers Fashion
Anonymous (not verified) — Mon, 01/02/2012 - 08:03nfl jerseys suppliers Fashion brand
wholesale coach bags the trend of fashion
coach outlet Don't miss the chance it's very good
coach outlet store comfortable with it
wholesale designer handbags well known great
coach handbags outlet attractive and reasonable price
cheap coach online shopping
coach outlet store may most likely need
coach handbag outlet A good thing
authentic nfl jerseys for sale fashion designed
cheap authentic nfl jerseys together with lifestyle
Post new comment