16.2. JSON and JSON-RPC
There's definitely a Greek theme with many of the names involved with using the XMLHttpRequest object. First there is Ajax itself, a legendary hero, followed by Microsoft's version called ATLAS, one of the Titans. Finally, there is JSON, pronounced "Jason," which stands for JavaScript Object Notation.
16.2.1. JavaScript Object Notation
Although I am by no means an expert on the subject, JavaScript Object Notation (JSON) works as a kind of replacement for XML. This might sound a little weird, but it makes perfect sense when viewed from a cross-browser point of view. The reason for this is that more web browsers support JavaScript than XML. This is just another way to distribute applications to as many people as possible.
JSON appears to work something along the lines of children's building blocks. With blocks, a few basic shapes are used in conjunction with imagination to create complex structures. The same can be said of JSON: A few basic "shapes" are used in conjunction with imagination to create complex structures. The only difference is that whereas children's blocks result in physical structures, JSON results in logical structures.
Let's take a look at the two basic data structures (blocks) that are used to create more complex structures in JSON. The first of these basic data structures is the name-value pair, which really isn't anything that we have not already seen in earlier chapters. Just think along the lines of a JavaScript collection or associative array, and you'll be fine.
The second basic data structure in JSON has the formidable description of "an ordered list of values." Ooh, sounds scary. In fact, it sounds a lot scarier than its actual name, array. Say "an ordered list of values," and people will pay attention; say "array," and unless you're talking about an array of missile silos, nobody cares.
These structures, in turn, are used to create somewhat more complex structures. The first of these more complex structures is an object; such objects consist of an unordered list of name-value pairs, with the following syntax for an empty object:
object_name { }
Of course, an empty object isn't very useful, so it is necessary to add members as string-value pairs. Of course, sometimes saying nothing is enough.
That is a high-level (as in, orbital) view of the concepts behind JSON. All we need to look at now is the actual syntax. After all, because the information going back and forth from the web server and the web browser has to be text, an internal representation of a JavaScript array would probably cause some problems when trying to send it to and fro.
16.2. JSON and JSON-RPC
There's definitely a Greek theme with many of the names involved with using the XMLHttpRequest object. First there is Ajax itself, a legendary hero, followed by Microsoft's version called ATLAS, one of the Titans. Finally, there is JSON, pronounced "Jason," which stands for JavaScript Object Notation.
16.2.1. JavaScript Object Notation
Although I am by no means an expert on the subject, JavaScript Object Notation (JSON) works as a kind of replacement for XML. This might sound a little weird, but it makes perfect sense when viewed from a cross-browser point of view. The reason for this is that more web browsers support JavaScript than XML. This is just another way to distribute applications to as many people as possible.
JSON appears to work something along the lines of children's building blocks. With blocks, a few basic shapes are used in conjunction with imagination to create complex structures. The same can be said of JSON: A few basic "shapes" are used in conjunction with imagination to create complex structures. The only difference is that whereas children's blocks result in physical structures, JSON results in logical structures.
Let's take a look at the two basic data structures (blocks) that are used to create more complex structures in JSON. The first of these basic data structures is the name-value pair, which really isn't anything that we have not already seen in earlier chapters. Just think along the lines of a JavaScript collection or associative array, and you'll be fine.
The second basic data structure in JSON has the formidable description of "an ordered list of values." Ooh, sounds scary. In fact, it sounds a lot scarier than its actual name, array. Say "an ordered list of values," and people will pay attention; say "array," and unless you're talking about an array of missile silos, nobody cares.
These structures, in turn, are used to create somewhat more complex structures. The first of these more complex structures is an object; such objects consist of an unordered list of name-value pairs, with the following syntax for an empty object:
object_name { }
Of course, an empty object isn't very useful, so it is necessary to add members as string-value pairs. Of course, sometimes saying nothing is enough.
That is a high-level (as in, orbital) view of the concepts behind JSON. All we need to look at now is the actual syntax. After all, because the information going back and forth from the web server and the web browser has to be text, an internal representation of a JavaScript array would probably cause some problems when trying to send it to and fro
16.3. ATLAS
ATLAS is Microsoft's answer to Ajax. Talk about a group that suffers from the "not invented here" syndrome. For those of you who are unfamiliar with this syndrome, it goes something along the lines of this:
-
If we didn't invent it, then it is evil.
-
If we can sell a knock-off, then the original is evil and ours is innovative.
-
In a product this innovative, there are bound to be some bugs, but we're not at fault.
The first time that I encountered this syndrome was in a computer terminal that was manufactured by the company I worked at. It had a detached keyboard that must have weighed 20 kilos or so, but it was considered superior to those terminals with keyboards that could be placed on one's lap, which is, in my opinion, the purpose of a detached keyboard.
Over the years, I've encountered the syndrome in various locations, usually associated with some kind of kludge. Usually it was a software kludge, either a homegrown procedure or utility that might have filled some kind of need, probably back during the Pliocene. Nevertheless, whatever it was, it was created locally and was, therefore, better than anything from any other source.
Of course, there is an alternative reason for Microsoft creating ATLAS beyond the "not invented here" syndrome. Perhaps Microsoft intends to either Balkanize the technology by creating incompatible alternatives or attempt to seize control by having their own flavor. There is, however, the additional possibility that they have allowed themselves to be blindsided again. Personally, I am most fond of the last possibility because it is kind of reassuring to think that the company that some consider to be "The Evil Empire" has once again missed the bus.
16.3.1. A Picture of ATLAS
Unfortunately, to use Microsoft's ATLAS technologies, it is necessary to have a machine running Windows and a copy of Visual Studio 2005. Although my laptop does run Windows XP Professional, I don't have a copy of Visual Studio 2005, and with a price tag of $549 for the Professional version, it isn't something that I will be purchasing in the near future. After all, $549 will buy a large number of seasons of Stargate SG1, Gummi Lab Rats, and turkey club sandwiches. For mad scientists, it is all a matter of priorities
0 comments:
Post a Comment