Critical.
Authoritative.
Strategic.
Subscribe to CIO Magazine »

JSON data interchange format gets standards blessing

Ecma approves the format, which offers an alternative to XML

An up-and-coming lightweight data interchange format for Web applications, considered by a growing number of people to be an alternative to XML, has gotten a boost from the standards body Ecma.

The Ecma General Assembly has approved the fifth edition of ECMAScript (PDF), according to Istvan Sebestyen, secretary general of the organization. Included in this new version of ECMAScript, of which the popular JavaScript is a dialect, is native support for using JavaScript Object Notation (JSON).

This inclusion "will certainly have a big impact on developers," said Douglas Crockford, the Yahoo software architect cited as the creator of JSON.

"JSON is already pretty widely-used in Web applications. By having JSON built into the ECMAScript language, [JSON] implementations will get faster and safer," Crockford said.

The approval is also a sign that the Web application development community is edging away from using XML as the sole desired standard for exchanging data among disparate systems, in at least those cases where delivery of relatively simple structured data is required.

The new standard, officially entitled ECMA-262, includes an object for both creating and parsing JSON texts. For the most part, it follows the 2006 Internet Engineering Task Force RFC 4627 authored by Crockford.

The new ECMAScript standard attempts to rectify a number of security issues surrounding JSON.

Over the past several years, a growing number of Web application developers used JSON instead of XML-based approaches, like the Simple Object Access Protocol, to mark up data so it can be transferred between two computers. This created two sometimes-opposing camps within the Web application development community.

"The split between the JSON and XML advocates is strong and will continue for the foreseeable future," said Daniel Markham, an Ajax architect and principal partner of the Virginia-based consulting firm Bedford Technology Group.

Advocates have praised JSON for its simplicity. According to the RFC, JSON was specifically developed to handle "the serialization of structured data." JSON is a set of conventions, or a grammar, on how to order the data to be transmitted so it can be parsed by the recipient. It borrows JavaScript's rules for formatting objects and arrays.

In contrast, XML relies on schema-based markup tags, which tend to make the datasets larger and more complex than those typically rendered in JSON.

"I'm an overall fan of JSON over XML, mainly because XML has a lot of syntactic fluff you have to dig through to get anything useful out of it. There's just an extra cognitive load that you don't have if your JavaScript objects match up closely with your server entities," Markham said.

Markham also noted that XML has a flexibility that JSON can't match. "XML remains the Swiss Army knife of the Internet: able to handle all sorts of data from any connector," he said.

Crockford formulated JSON in 2001 when working on a number of Web applications using the Ajax set of web development tools, which includes JavaScript, XML and HTML. He found XML to be too bulky for his needs.

"XML was just inexcusably ugly and inefficient, and so we came up with using JavaScript's own data representation to represent the data," Crockford said. Crockford is widely cited as being the inventor of JSON, though he is modest about assuming this appellative. "It already existed in nature. I just discovered it," he said.

Since its creation in 2001, JSON has grown in popularity. The JSON.org site lists a number JSON converters for languages such as Perl, Active Server Pages, PHP, C, Java, Python and others. Yahoo supports JSON for its Web services.

The latest versions of Internet Explorer and Firefox both have JSON support. JSON "looks like it will be the first bit of ECMAScript 5 that will be rolled out universally," Crockford said.

JSON itself has always been a part of ECMAScript, at least insofar as Crockford used ECMAScript grammar as the basis for JSON. The difference with ECMAScript 5, Crockford noted, is that ECMAScript has "built-in library support" for JSON. This will help in matters of security.

Most developers used the JavaScript eval() function to parse JSON-based text into usable data structures. Security professionals see this approach as a security flaw, because this form of input could allow third-parties to insert malicious code. The new parser eliminates the need to use the eval() function, Crockford said.

Tim Bray, a co-creator of the XML format and director of Web technologies at Sun Microsystems, noted that XML practitioners he has worked with see the value of JSON.

"XML has a bunch of features which make it possible to interchange documents (blog pieces, news releases, medical records), and these can be superfluous for interchanging pure data," he noted by e-mail. "JSON works really well for interchanging that kind of stuff and, like XML, is nicely vendor-independent."

Bray doubts the ECMA blessing will have much impact on further JSON adoption though, since it is already widely used and doesn't suffer from the interoperability problems that standards usually address.

"Obviously, there's no harm in the ECMAScript [revision] recognizing the reality of JSON [but] JSON is already deeply implanted in Web IT culture."

ECMAScript is the vendor-neutral version of the JavaScript programming language, which was originally created by Netscape as a scripting language for Web browsers.

Join the CIO Australia group on LinkedIn. The group is open to CIOs, IT Directors, COOs, CTOs and senior IT managers.

More about: ECMA, Hewlett-Packard, HP, Internet Engineering Task Force, Sun Microsystems, Yahoo
References show all

Comments

Post new comment

The content of this field is kept private and will not be shown publicly.
Users posting comments agree to the CIO comments policy.
Login or register to link comments to your user profile, or you may also post a comment without being logged in.
Related Coverage
Related Whitepapers
Latest Stories
Community Comments
Tags: data integration, javascript, JSON, XML
Latest Blog Posts
Whitepapers
  • IDC Forecast: Worldwide Purpose - Built Backup Appliance 2011 – 2015, Forecast Update: Explosive Growth in 2011
    This IDC Forecast Update provides share positions for revenue and raw capacity for nine named PBBA vendors for the first half of 2011. In addition, this study provides the market size and a five-year forecast for the worldwide PBBA market as part of IDC's Storage Solutions coverage. The five-year forecast includes total factory revenue and raw capacity in terabytes through 2012. The worldwide PBBA market covers both open system-and mainframe-attached products.
    Learn more »
  • Oracle SOA vs. IBM SOA - Customer Perspectives on Evaluating Complexity and Business Value
    The Service-Oriented Architecture (SOA) model has become the cornerstone of business computing. Its ability to greatly accelerate the development of business-critical applications promotes business agility, decreases time-to-value and total cost of ownership (TCO), and greatly increases the efficiency and strategic value of IT. SOA implementations tend to be complex, IT decision makers should carefully consider their choice of a SOA platform in terms of its ability to simplify the fundamental development, deployment, and management tasks involved. Read on.
    Learn more »
  • There is a HP Printer for everyone
    The following printer categories are highly recommended for the respective customer segments. While these printer categories remain as the primary recommendations, you will find alternative models listed in the product line up charts.
    Learn more »
All whitepapers
rhs_login_lockGet exclusive access to Invitation only events CIO, reports & analysis.
Recent comments