Finding a single development environment for all purposes has so far proven an unattainable goal. But with the advent of rich Internet applications (RIA), development nirvana gets a bit closer.
[ For more on info on rich Internet application platforms, check out "Not your father's Web: The year in RIAs" | And keep up with app dev issues and trends with InfoWorld's Fatal Exception and Strategic Developer blogs. ]
In the past year or so, a number of cross-platform RIA technologies have been released that can double as desktop application technologies. I'll discuss four technologies that accomplish this trick: Adobe AIR, Curl Nitro, Google Gears, and Microsoft Silverlight. I installed them all, explored them, and used them for several months in the course of my work.
[ Check out the InfoWorld Test Center review: Adobe AIR soars to loftier heights. ]
AIR adds a number of desktop-specific classes and components to Adobe's base Flash and Flex classes. AIR 1.5 applications can update themselves, interact with the system clipboard, use the file system, use native windows and menus, use a local SQL database, and store encrypted data. AIR also supplies a number of capabilities to the desktop environment for which Flash and Flex applications normally rely on the browser -- for example, HTML rendering, HTTP handling, and network detection.
Publicly available Adobe AIR applications at the AIR Showcase range from simple desktop widgets to full-blown applications. AIR is supported for development and runtime on Windows, Mac OS X, and Linux.
I am more of a Flex and AJAX developer than a Flash designer. I found the AIR extensions to Flex fairly straightforward to learn and use from Flex Builder, although I would have been happier if the AIR documentation were included in the Flex Builder help file instead of only being available online.
AIR runtime, AIR SDK, Flex 3 SDK, and Aptana Studio are free. Pricing for Aptana Studio Pro is $199, $699 for Adobe Flash CS4 Professional, $249 for Adobe Flex Builder 3 Standard, $699 for Adobe Flex Builder 3 Professional, and $399 for Adobe Dreamweaver CS4.
Nitro is the cross-platform desktop extension to Curl. Currently in its second beta-test release, Nitro adds an applet installer, desktop controls and a client-side SQLite database to Curl's excellent RIA capabilities. Nitro applications take advantage of Curl's high-performance, skin-able user interface and built-in security sandbox. Even without Nitro, detached Curl applets can be used for desktop applications: The Curl IDE and help system are good examples of that.
Curl may not be as familiar to you as the competing products from Adobe (AIR), Google (Gears), and Microsoft (Silverlight), but you shouldn't let that deter you from trying it. It has CPU-bound runtime performance roughly 10 times that of Adobe AIR, according to a test of JPEG encoding conducted by Curl in May. (The test was pooh-poohed as "irrelevant" by Adobe, but not refuted.)
In addition to high-computing speed, Curl has (according to my own speed tests) very high-performance graphics, at least on the Windows platform when using DirectX. It also has demonstrably strong security. (Curl has criticized the Adobe AIR security model as having a huge hole in its signing certificate scheme.)
The Curl language may be new to you, but it isn't hard to learn. In addition to providing copious documentation, Curl supplies many excellent samples with source code, a number of interactive tutorials on application-specific topics called Curl Cues, a Curl IDE Made Easy interactive training program and online courses on the Curl language, the Visual Layout Editor, and the Curl application development process.
I was initially baffled when I looked for the Nitro extensions in the current Curl IDE documentation. Then I looked at the source code for the three Nitro samples supplied on the Curl Web site, and that made it clear where to find the Nitro functions in the Curl libraries. One of the Nitro samples did not work for me, however, because of a problem with the Facebook API. The other two samples worked very well.
The Curl RTE (runtime environment) runs on Windows, Mac OS X, and four versions of Linux. The Curl IDE runs on Windows and Linux. The Curl development plug-ins for Eclipse work with Eclipse 3.3 and 3.4 on Windows and Linux platforms.
The base Curl IDE and runtime that include Nitro are free, as are deployment licenses for publicly available, free Web sites that use the base capabilities. A Curl Pro/Deployment license starts at $12,000; Curl has pricing models designed for enterprise, Internet, software-as-a-service and reseller business models.
Basically, Google Gears is a way to take Web applications offline in a browser. Curl Nitro and Adobe AIR can go one step further and dispense with the browser.
The online Gears developer documentation discusses Version 0.5, released a month ago. It includes nine samples that illustrate the use of the APIs. You can download the source to all of these samples, plus some articles, a couple of tools, and an Apache mod implementing the resumable HTTP request proposal. One of the articles is a tutorial on taking Web applications offline with Gears, written by Omar Kilani of Remember the Milk. Kilani and his team implemented offline functionality for their application in "four caffeine-fueled days."
[ Check out the InfoWorld Test Center review: Silverlight, for real this time. ]
Silverlight 2 supports local data caching and isolated local storage, which is one reason to consider it for use as a desktop RIA, although like Google Gears it runs inside a browser. There's also another scenario to consider: With care, you can write a Silverlight Web application that can also be recompiled to be distributed as a WPF desktop application, and the WPF application would stand alone but be able to connect to the Internet as needed. Note that it's much easier to write a Silverlight application and recompile it for WPF than it is to take a WPF application and rewrite the parts that aren't supported by Silverlight.
Silverlight 2 runs as a runtime on Windows XP, Windows Vista, and Mac OS X on Intel-based Macs. Current versions of IE, Firefox, and Safari are officially supported, with "others pending customer feedback"; I have also used Silverlight 2 successfully with current versions of Google Chrome and Opera. The Microsoft development and design tools require Windows; an Eclipse plug-in for Silverlight currently requires Windows but will eventually support other operating systems. The Linux implementation of Silverlight 2 is called Moonlight 2 and is currently in an alpha state.
Silverlight has copious documentation and very good tool support. Developers typically work on Silverlight applications using Visual Studio 2008 on Windows; designers typically work on the same project using Expression Blend 2, also on Windows. Both of these tools are very good for their target audiences, but not for their secondary audiences. That is, Visual Studio 2008 is great for coding and XAML text editing and can preview XAML pages, but can't do visual XAML page design; Expression Blend 2 is great for visual XAML page design but doesn't support coding. The future Visual Studio 2010 product, now in preview, will combine both sets of capabilities.
I am not especially impressed with the Silverlight 2 local data caching and isolated storage facilities, which are not safe from access by unmanaged code and lack an actual database. (For many occasionally connected applications, you want a local database not only to cache information read from the remote database, but also to store updates to be sent to the remote database when the connection is restored. It's easier, more efficient, more secure, and more reliable to do this with a local database than with a simple caching facility.)
On the other hand, I'm very enthusiastic about Silverlight 2 as an RIA. If I wanted to build a Silverlight Web application and needed a desktop version as well, I would lean toward separately compiling the application for WPF. I would expect to have more than 90 percent of the code shared between the two projects if planned properly.
The Silverlight plug-ins, Silverlight SDK, .Net Framework, and Visual Studio Express Editions are free; Visual Studio 2008 Standard Edition is $299 ($199 upgrade); Professional Edition is $799 ($549 upgrade). Subscriptions range from $1,199 for Visual Studio Professional with MSDN Professional up to $10,939 for Visual Studio Team System 2008 Team Suite with MSDN Premium. Expression Blend 2 is $499 ($99 upgrade).
The first question to ask when picking a desktop RIA is how the application will be used, both as a Web application and a desktop application. Then list the features you need. Are those features present in the RIAs you are considering? Are there ways to add missing features? Are you looking to enable fully or occasionally connected scenarios?
Once you've got your questions ready, you can figure out which RIA is best for your needs.
Would it be better if you had separate desktop and Web applications that shared a common code base? If so, consider a combination of WPF and Silverlight.
Will your application have CPU-bound portions? If so, consider Silverlight and Curl Nitro.
Does your application need to run locally without a browser? If so, consider AIR and Curl Nitro.
Do your developers already know WPF and the .Net Framework? If so, consider Silverlight. Do they already know Flash and Flex? If so, consider AIR.
Do you already have an AJAX Web application? If so, consider AIR and Gears.
Finally, ask yourself if you really need a desktop RIA at all. Sometimes building a second interface for an application is a relatively small effort, if most of the work is being done by a common back end or if most of the code is common to both versions of the application. In the larger picture, sometimes the advantages to users of having separate but optimized desktop and Web user interfaces may outweigh the costs and time involved.
Martin Heller is a software developer and consultant, as well as an InfoWorld contributing editor. He writes the Strategic Developer blog. Computerworld is an InfoWorld affiliate.
This story, "Rich Internet apps that double as desktop apps" was originally published by Computerworld.