Welcome!

Machine Learning Authors: Zakia Bouachraoui, Liz McMillan, Roger Strukhoff, Pat Romanski, Carmen Gonzalez

Related Topics: Machine Learning

Machine Learning : Article

Real-World AJAX Book Preview: A Brief Note on JSON

Real-World AJAX Book Preview: A Brief Note on JSON

This content is reprinted from Real-World AJAX: Secrets of the Masters published by SYS-CON Books. To order the entire book now along with companion DVDs for the special pre-order price, click here for more information. Aimed at everyone from enterprise developers to self-taught scripters, Real-World AJAX: Secrets of the Masters is the perfect book for anyone who wants to start developing AJAX applications.

A Brief Note on JSON
The object notation used by JavaScript has made its way into a way to transmit structure better in a number of different languages. JSON (JavaScript Object Notation) has gained a fair amount of interest as a somewhat lighter-weight alternative to XML, especially when used across pipes for AJAX transmission.

In essence, the idea is that you can serialize any object's state as a hash of other objects, each of which can also be broken down as a hash of either other objects or primitives. For instance, you could create a JSON object of a person's record, including his address:

var rec = {identity:{ firstName:"Aleria", surName:"Delamare", gender:"female"},
address:{ street: "1234 Fairmont Drive", city:"Arkham", state:"MA"}, display:
function(){alert(this.identity.firstName +" " + this.identity.surName);} }

The advantage of JSON is that when transmitted, such objects can be reconstructed easily (especially if going from a JavaScript environment to a JavaScript environment) without specialized parsers. The disadvantage of JSON is that it doesn't necessarily transmit state as effectively as XML does in heterogeneous environments. However, a significant number of AJAX applications now routinely make use of JSON as their primary serialization method, especially for client-to-client communications.

Summary
I've tried the near impossible in this (loooong) chapter - covering the highlights of JavaScript in a single chapter of a book. It was, at best, only a partially successful endeavor, as there are obviously many, many elements that could have been covered in greater detail (date manipulation, for instance) that weren't for lack of space. However, if all that had been covered, this would have been a book on JavaScript basics, not the power and beauty of AJAX.

This chapter has focused on the client application, but AJAX also has a fairly formal server-side requirement. In Chapter 3, the server-side components of AJAX will be explored in greater detail, showcasing how AJAX is not only a rich client application but actually a design methodology for changing the role of both client and server.

This content is reprinted from Real-World AJAX: Secrets of the Masters published by SYS-CON Books. To order the entire book now along with companion DVDs, click here to order.

More Stories By Kurt Cagle

Kurt Cagle is a developer and author, with nearly 20 books to his name and several dozen articles. He writes about Web technologies, open source, Java, and .NET programming issues. He has also worked with Microsoft and others to develop white papers on these technologies. He is the owner of Cagle Communications and a co-author of Real-World AJAX: Secrets of the Masters (SYS-CON books, 2006).

Comments (0)

Share your thoughts on this story.

Add your comment
You must be signed in to add a comment. Sign-in | Register

In accordance with our Comment Policy, we encourage comments that are on topic, relevant and to-the-point. We will remove comments that include profanity, personal attacks, racial slurs, threats of violence, or other inappropriate material that violates our Terms and Conditions, and will block users who make repeated violations. We ask all readers to expect diversity of opinion and to treat one another with dignity and respect.


CloudEXPO Stories
The precious oil is extracted from the seeds of prickly pear cactus plant. After taking out the seeds from the fruits, they are adequately dried and then cold pressed to obtain the oil. Indeed, the prickly seed oil is quite expensive. Well, that is understandable when you consider the fact that the seeds are really tiny and each seed contain only about 5% of oil in it at most, plus the seeds are usually handpicked from the fruits. This means it will take tons of these seeds to produce just one bottle of the oil for commercial purpose. But from its medical properties to its culinary importance, skin lightening, moisturizing, and protection abilities, down to its extraordinary hair care properties, prickly seed oil has got lots of excellent rewards for anyone who pays the price.
The platform combines the strengths of Singtel's extensive, intelligent network capabilities with Microsoft's cloud expertise to create a unique solution that sets new standards for IoT applications," said Mr Diomedes Kastanis, Head of IoT at Singtel. "Our solution provides speed, transparency and flexibility, paving the way for a more pervasive use of IoT to accelerate enterprises' digitalisation efforts. AI-powered intelligent connectivity over Microsoft Azure will be the fastest connected path for IoT innovators to scale globally, and the smartest path to cross-device synergy in an instrumented, connected world.
There are many examples of disruption in consumer space – Uber disrupting the cab industry, Airbnb disrupting the hospitality industry and so on; but have you wondered who is disrupting support and operations? AISERA helps make businesses and customers successful by offering consumer-like user experience for support and operations. We have built the world’s first AI-driven IT / HR / Cloud / Customer Support and Operations solution.
ScaleMP is presenting at CloudEXPO 2019, held June 24-26 in Santa Clara, and we’d love to see you there. At the conference, we’ll demonstrate how ScaleMP is solving one of the most vexing challenges for cloud — memory cost and limit of scale — and how our innovative vSMP MemoryONE solution provides affordable larger server memory for the private and public cloud. Please visit us at Booth No. 519 to connect with our experts and learn more about vSMP MemoryONE and how it is already serving some of the world’s largest data centers. Click here to schedule a meeting with our experts and executives.
Darktrace is the world's leading AI company for cyber security. Created by mathematicians from the University of Cambridge, Darktrace's Enterprise Immune System is the first non-consumer application of machine learning to work at scale, across all network types, from physical, virtualized, and cloud, through to IoT and industrial control systems. Installed as a self-configuring cyber defense platform, Darktrace continuously learns what is ‘normal' for all devices and users, updating its understanding as the environment changes.