- We design and build extraordinary applications for companies looking to make the next great idea a reality.
- learn more
Cross Domain Comet
I hate to be a blog echo chamber, but there's a post from Alex Russell of Dojo Toolkit that is worth spreading around a bit more.
First, some background. There are two technologies that Alex and Co. have been working on. One is called JSONP, which stands for JSON with Padding. The essential idea is that you can insert a script tag dynamically in a document and have it pull a script from a server in a different domain. This URL for this script takes a parameter that is prepended to the JSON which is also wrapped in parentheses. In the case where the prefix is null, we have just a JSON object. Otherwise, it's a function call. This gives us the ability to do a callback when the script loads; you want to do a callback, otherwise, how will you know that the thing loaded? Obviously, this requires some cooperation from the server -- you can't just do this with any old JSON service. A discussion by Alex of this technology can be found here. Dan Theurer has a somewhat clearer explanation, IMHO, of a similar technology used by Yahoo.
The other technology is Cometd. What is Comet? Without getting too technical, when a web application is to update a browser using AJAX, the browser "polls" the client, i.e. it keeps opening up connections to the server to ask "is it ready?" With Comet, the browser opens up a connection to the server and keeps it open until the server has something to say. There are all sorts of issues in doing this, from limitations of the HTTP protocol, to the Servlet specification, to the consumption of resources on servers and network appliances that are expecting short connections. Cometd is a server that tries to solve some of the issues.
What Alex has done is combine Cometd and JSONP to allow cross domain Comet. You can read Alex's post here...
Is Cross Domain AJAX/Comet a 'Good Thing?'
There's a school of thought that AJAX apps should really be the SOA orchestrator of various backend services from various domains -- a little Amazon S3 here, a little Google maps there, a little Yahoo mail there -- and voila!, the ultimate mashup. While it is seductive to think you can assemble applications in this way, it makes me nervous for some reason that I can't quite articulate. Having been the victim of bad SOA governance within companies, I have to think that these types of applications will be very brittle at the least, and vulnerable to security exploits at the worst.
Topics: Ajax Frameworks, COMET, Editorial
Comments: 1 so far
Leave a comment
About Pathfinder
Recent
- Walk-Through Test Coverage
- Where minimalism fails: The problem with Apple’s less-is-more approach
- jQuery goodness with ASP .NET
- Design Thinking
- Bullseye Diagram
- Roles Testing For Security
- Blackbird takes the pain out of JavaScript logging
- Making GWT JSON not Quite so Painful
- IDEA - preconference workshop 06 Oct 08
- HTML5, Ajax history management, and The Ajax Experience 2008 Boston
Archives
- October 2008
- September 2008
- August 2008
- July 2008
- June 2008
- May 2008
- April 2008
- March 2008
- February 2008
- January 2008
- December 2007
- November 2007
- October 2007
- September 2007
- August 2007
- July 2007
- June 2007
- May 2007
- April 2007
- March 2007
- February 2007
- January 2007
- December 2006
- November 2006
- October 2006
- September 2006
- August 2006
- July 2006
- June 2006
- May 2006
- April 2006
- March 2006


I am very much in line with “Is Cross Domain AJAX/Comet a ‘Good Thing?’” except for the conclusion.
In my experience, I built a Portal where a Portlet offered an end-user a choice to choose the source of financial information out of the list of providers like Morningstar or Lipper Ltd (A Reuters Company). At the back, I provided corresponding services.
Now, getting into the SOA age of business-centric architecture, I share some concerns about brittleness and vulnerability. However, if one follows the SOA RM standard and avoids ‘bold’ Web Services (initially provided by Amazon, Google and Yahoo!) but, instead, relies on the business execution contexts and Service Contracts that include business responsibilities of the service providers (including security and QoS), the compound application might be not that bad at all.
This means, there should be an intermediary responsible for the quality of offered services and their compatibility. In other words, an orchestration/composition of the services, performed by the user, only looks ‘ad-hock’ while it is very well prepared by the intermediary.
What is about an end-user just composing different services in the Web site? It is absolutely fine; it is called a ‘freedom of choice’. Such end-user becomes the author of the thing we can call a ‘custom application’, s/he is the master and the owner of it. And all problems and concerns are on her/his hands. Exactly as it is in real business life (“it is a simple SOA, stupid”)
- Michael Poulin
Comment by Michael Poulin, Monday, December 11, 2006 @ 9:00 am