Beyond JSON - The Emergence
Previous - Beyond JSON - Flashback
In late nineties, there was a greater push to keep finding
the technology for the distributed systems. The biggest challenge was the data
exchange between the systems. There is
something happening in parallel. The
emergence of WWW.
In 1989, Tim Berners-Lee wrote a memo proposing an Internet-based
hypertext system. Berners-Lee specified HTML and wrote the browser and server
software in late 1990. Browsers became the interpreters for the HTML and we saw
the success one of the first truly intended distributed system with runtime
interpretation in as early as 1990. Soon people started analyzing the
possibility of HTML as the data exchange format. This led to the revolution of emergence of XML. It was about to
change the way we think about the distributed systems.
Everyone was sure about the success and there was a need to
standardize the specifications for cross platform and application data exchange.
XML 1.0 specifications came around 1998. The design goals of XML emphasize
simplicity, generality, and usability across the Internet. It is a textual data
format with strong support via Unicode for different human languages.
There was a flood of the Application Programming Interfaces
(APIs) by the developers for parsing the XML data in various languages, which
helped in the acceptability and adaptability of XML as the de-facto data
exchange format in late 1990s and early 2000s
The XML became the desired format for being utilized for
complex data structures for web services but also becoming an increasingly
popular format for documents (RSS, ATOM, SOAP, SVG and XHTML). What we usually
ignore is the fact that XML is beyond data format. XML is a language. Below are
the features of XML as a language, which makes it highly usable in most of the
scenarios;
1.
XPath - XPath (XML Path Language) is a query
language for selecting nodes from an XML document. In addition, XPath may be
used to compute values (e.g., strings, numbers, or Boolean values) from the
content of an XML document. The World Wide Web Consortium (W3C) defined XPath.
2.
Attributes and namespaces
3.
XML Schema - An XML Schema is a language for
expressing constraints about XML documents. There are several different schema
languages in widespread use, but the main ones are Document Type Definitions
(DTDs), Relax-NG, Schematron and W3C XSD (XML Schema Definitions)
4.
XSL - The term Extensible Stylesheet Language
(XSL) is used to refer to a family of languages used to transform and render
XML documents
As our software never keeps evolving, there was something
interesting happening in the sidelines. The browsers came to interpret the html
and present the data to end user. Netscape took the lead with browser in 1994
to display static pages. They soon realized the power of web and there was a
desire in the web development scene to remove the limitation of static pages,
so in 1995, Netscape decided to add a scripting language to make it dynamic.
Microsoft started ruling the desktop computing the world and
came up with their own browser Internet Explorer and their own scripting
language Jscript in 1996. Microsoft market share in browsers was 95% by early
2000s
During the period of Internet Explorer dominance in the
early 2000s, client-side scripting was stagnant. This started to change in
2004, when the successor of Netscape, Mozilla, released the Firefox browser.
Firefox was well received by many, taking significant market share from
Internet Explorer. However, In 2005 Mozilla and Adobe tried standardizing
Action Script 3 as ES4 implementation but because of lack of support from
Microsoft, it did not reach anywhere.
Something was brewing in the open source world in 2005, AJAX was being conceptualized.
Wait……………….. Where is our hero JSON in the story.
Its time to introduce him………………
Early 2000 was the time when XML ruled the world as data
exchange. XML was the first platform neutral data exchange mechanism adopted
across the world. With the emergence of SOA, everyone needed a platform neutral
mechanism for the services to interact. Before that, we still had services
(server and client components) with technologies like EJB, RMI, COM etc.
However, these are not platform neutral data exchange mechanism. First ray of
hope came with SOAP protocol with XML used for data exchange. Being platform
neutral was such a big advantage that as soon as we started having libraries
for marshaling and un-marshaling XML it captured the space in the distributed
middleware.
The IT world from 2001 was trying for a solution to exchange
data between browser and the application. Crockford and Morningstar had decided
that they could abuse an HTML frame to send themselves data. They could point a
frame at a URL that would return an HTML document like the one above. Crockford
and Morningstar were trying to build AJAX applications well before the term
“AJAX” had been coined.
This does not mean that JSON came into existence in 2001. As
you can see from previous chapter, that Javascript has been existing since 1996
and hence the mechanism to represent Javascript object structure, which was JSON.
Only in 2001, there was an attempt made the utilize JSON for data interchange.
Since 1999, Microsoft did had the XMLHttpRequest to enable AJAX request through
framework called AtiveX controls but the solutions would have been specific to
IE. The reason this solution was not used as a viable solution as it would not
have worked for Netscape or other platforms. Crockford and Morningstar had
decided that they could abuse an HTML frame to send themselves data. They could
point a frame at a URL that would return an HTML document like the one above.
JSON got a big boost in 2005. That year, a web designer and
developer named Jesse James Garrett coined the term “AJAX” in a blog post. He
wrote that “XML is the most fully-developed means of getting data in and out of
an AJAX client, but there’s no reason you couldn’t accomplish the same effects
using a technology like JavaScript Object Notation or any similar means of
structuring data. This possibility and the simplicity of JSON flooded the IT
space with JSON parsers.
People say that XML is bulkier; I believe it is the same
argument as “convention over configuration”. If you follow convention strictly,
you would not need bulky configurations. Another argument we always hear is the
various specification with XML and sub languages like RSS, SOAP, SVG and
others, which makes it confusing. Well JSON is so simple and lean that it can
only be JSON. And we never tried having variations in JSON due to the learning
from the state of XML, it just remain plain simple JSON.
I somehow feel that there are two historical events, which
made the space and the platform for JSON to launch itself. First, the effort of
XHTML halted in early 2000. This would have established XML further as the
standard for data exchange. Parsing would have been so less error prone after
this, which was a major pain point for application developers. Second, most
importantly, lack of support for Action Scripts. Action script was a solution
for rich client using AJAX (conceptually) and performing binary data exchange.
By 2005, world had learned the advantages for open standards and disadvantages
of proprietary solutions. The stage was set for JSON to emerge.
Next - Beyond JSON – The Dominance
Comments
Post a Comment