| By Yakov Fain | Article Rating: |
|
| January 15, 2008 07:30 AM EST | Reads: |
14,573 |
Browser Incompatibilities
Challenge #1: Reporting requires complex UI programming, but maintaining browser-specific code is a huge effort. Optimizing code delivery is an art. Optimizing data delivery isn't easy because it needs to support ever-changing protocols (SOAP, REST).
Solution: Flash Player is a virtual machine that works the same way in every browser
Challenge #2: Code packaging (in Internet Explorer Web Services are packaged as HTC, which is not supported by Mozilla browsers.
Solution: Use a browser-agnostic invisible Flash Player-based agent that supports communications with Web Services regardless of the Web browser you're using.
Performance
Challenge #3: Large JavaScript projects such as reporting applications need to be loaded, pre-processed, and executed on every page load
Solution: Use Flash agents that are pre-compiled, compressed, and optimized for streaming and caching.
Robustness
Challenge #4: The HTTP protocol is very forgiving because it was optimized for non-reliable networks. Web browsers were designed to display whatever has arrived with a Web page. If a page includes an image, which was not available at the moment, you'll see an icon of the broken image, and, maybe an alternative text. But what if a piece of JavaScript code doesn't arrive for whatever reason?
There's no built-in way to ensure the delivery of JavaScript. This means that AJAX programmers have to write additional code just to check if the application code has arrived. On top of this, Web browsers offer mediocre debugging support.
Solution: Use a virtual machine with reliable code delivery and good development and debugging tools.
Web Browsers Have an Unpredictable Future
Challenge #5: Software vendors don't seem to be eager to invest into browsers. Microsoft is investing in .NET (WPF) and Silverlight, which runs on CLR. Adobe is developing AIR. Sun Microsystems is about to release a small consumer VM for rich Internet applications written in Java and JavaFX.
Solution: Select a ubiquitous technology (currently it's Flash Player) that offers a solid development and deployment environment.
I've listed some major challenges that any RIA developers would face regardless of what protocol they use for data delivery. Recently, our company, Farata Systems, which was working mainly with Flex/Java applications, decided to create a version of our ClearBI reporter as a component for AJAX applications as well. After experimenting with various protocols, we created a component called WebService.swf, which is a Flash Player and can easily turn a SOAP Web Service into an object with methods that correspond to WSDL operations, and the XML processing is done using ECMAScript for XML (E4X), which lets you avoid XML parsing headaches
Figure 1 shows an HTML/JavaScript application that uses an invisible Flash Player component (WebService.swf) and one visible (ClearBI.swf). In this example we'll use the data coming from a publicly available book search Web Service off Amazon .com.
The entire process works like this:
1. The JavaScript code gives a URL of Amazon's WSDL to a hidden WebService.swf.
2. The WebServices.swf loads WSDL from Amazon and automatically converts XML into an object with properties (it uses E4X as will be explained below).
3. The JavaScript asks WebService.swf to call the selected operation from Amazon's WSDL.
4. WebService.swf gets the data and passes them to JavaScript (XML or JavaScript objects). If you're just interested in simplified processing of SOAP in your AJAX application, you don't need to do step 5 - WebService.swf is all you need.
5. To produce reports that look as shown below and can be customized by the end users, pass the data from JavaScript to ClearBI swf.
What's Under the Hood
The entire workflow consists of two major steps described below: (Figure 2)
1. Using JavaScript initialize the WebService.swf object, register event listeners, and load the WSDL:
Var ws=com.farata.jsfx.WebServices("MyWebService");
Add the WSDL load listener
ws.addEventListener("serviceload", onWsdlLoaded);
Add the error listener
ws.addEventListener("servicefault", onError);
Initialize the WebService.swf with wsdl. Load wsdl and notify ServiceLoadListeners on success.
ws.useService("http://soap.amazon.com/schemas2/AmazonWebServices.wsdl", "Amazon");
This call will load Amazon's WSDL, which among other things will contain the operation KeywordSearchRequest:
<wsdl:message name="KeywordSearchRequest">
<wsdl:part name="KeywordSearchRequest" type="typens:KeywordRequest"/>
</wsdl:message>
As you can see, this operation expects an argument of a KeywordRequest type that is described in the same WSDL:
<xsd:complexType name="KeywordRequest">
<xsd:all>
<xsd:element name="keyword" type="xsd:string"/>
<xsd:element name="page" type="xsd:string"/>
<xsd:element name="mode" type="xsd:string"/>
<xsd:element name="tag" type="xsd:string"/>
<xsd:element name="type" type="xsd:string"/>
<xsd:element name="devtag" type="xsd:string"/>
<xsd:element name="sort" type="xsd:string" minOccurs="0"/>
<xsd:element name="variations" type="xsd:string" minOccurs="0"/>
<xsd:element name="locale" type="xsd:string" minOccurs="0"/>
</xsd:all>
</xsd:complexType>
Published January 15, 2008 Reads 14,573
Copyright © 2008 SYS-CON Media, Inc. — All Rights Reserved.
Syndicated stories and blog feeds, all rights reserved by the author.
More Stories By Yakov Fain
Yakov Fain is a Managing Director of Farata Systems, consulting, training and product company. He has authored several Java books, dozens of technical articles. SYS-CON Books released his latest co-authored book , Rich Internet Applications with Adobe Flex and Java: Secrets of the Masters in Spring 2007. Sun Microsystems has nominated and awarded Yakov with the title Java Champion. He leads the Princeton Java Users Group. He is an Adobe Certified Flex Instructor. Currently Yakov works on the book for O'Reilly "Enterprise Application Development with Flex". He twits at twitter.com/yfain.
- Kindle 2 vs Nook
- Cloud Computing on Gartner's Top 10 List and SYS-CON Events' 2010 Calendar
- Confessions of a Ulitzer Addict
- IBM Hardware Chief, Intel VC Exec Arrested in Insider Trading Scam
- Tactical Cloud Computing Panel at 1st Annual GovIT Expo
- Ulitzer.com Named Exclusive "New Media" Sponsor of Cloud Computing Conference & Expo
- Moving Your RIA Apps into the Cloud: Seven Challenges
- Adobe’s Aiming ColdFusion at Multiple Clouds
- Windows 7 – Microsoft’s First Step to the Cloud
- Ulitzer Provides a Powerful Social Journalism Platform
- Jill Tummler Singer, Deputy CIO of CIA, Keynotes at GovIT Expo
- Open Source Mobile Cloud Sync and Push Email
- Kindle 2 vs Nook
- The Difference Between Web Hosting and Cloud Computing
- Cloud Computing on Gartner's Top 10 List and SYS-CON Events' 2010 Calendar
- Ajax in RichFaces 3.3, JSF 2 and RichFaces 4
- Confessions of a Ulitzer Addict
- IBM Hardware Chief, Intel VC Exec Arrested in Insider Trading Scam
- My Thoughts on Ulitzer
- Tactical Cloud Computing Panel at 1st Annual GovIT Expo
- Ulitzer.com Named Exclusive "New Media" Sponsor of Cloud Computing Conference & Expo
- US Post Office Hops a Ride on NetSuite’s Cloud
- Moving Your RIA Apps into the Cloud: Seven Challenges
- Adobe’s Aiming ColdFusion at Multiple Clouds
- Building a Drag-and-Drop Shopping Cart with AJAX
- What Is AJAX?
- Google Maps! AJAX-Style Web Development Using ASP.NET
- Flashback to January 2006: Exclusive SYS-CON.TV Interviews on "OpenAjax Alliance" Announcement
- AJAXWorld Conference & Expo to Take Place October 2-4, 2006, at the Santa Clara Convention Center, California
- AJAX Sponsor Webcasts Are Now Available at AJAXWorld Website
- How and Why AJAX, Not Java, Became the Favored Technology for Rich Internet Applications
- "Real-World AJAX" One-Day Seminar Arrives in Silicon Valley
- AJAXWorld University Announces AJAX Developer Bootcamp
- AJAX Support In JadeLiquid WebRenderer v3.1
- Where Are RIA Technologies Headed in 2008?
- Struts Validations Framework Using AJAX




































