OverviewThis post evaluates 3 alternative technologies for implementing RIA: Ajax, Adobe Flex, and Microsoft Silverlight. Each of the three has strengths and weaknesses when compared across any single dimension, which makes it difficult to determine which technology is the correct choice for a particular problem.
This table compares the three technologies across a number of distinct criteria. Each criterion is weighted between 1 and 10 based on my own subjective evaluation. Depending on the project you might assign very different weightings. A breakdown of the criteria along with rationale for the ratings is captured below.
ScoringIf a technology has a clear strength in a particular category it is shaded green and gets the full weight added to its total value. If there are concerns in a category it is shaded yellow and given half the weight added to its total value. Red signifies that the category is a weakness of the technology choice and it is given a value of .1 of the total weight.
Based on the criteria and weightings Flex has a slight edge over Silverlight and Ajax.
The Criteria
Maturity / AdoptionThis is ranked very high above, since there is a high risk of unanticipated issues with technologies that have not yet proven themselves.
Ajax has been around for several years now, and is used in one form or another by a very large percentage of major websites. There are a large number of toolkits and libraries available (Dojo, Tibco, Scriptaculous, GWT, etc.)
Flex has been around since 2004. It is currently on the 3rd major version. Many major companies have begun developing Flex applications (Business Objects, SAP, Fedex, etc.), but Flex is still considered a young technology.
Silverlight is a Microsoft competitor to Flex that was first released in 2006. It is seen as being a direct competition to Flex. There are fewer Silverlight applications than Flex, but it is likely that Microsoft will close the gap over the next 2 years. One notable early adopter is Netflix, which uses Silverlight for Video on Demand.
Programmer familiarityProgrammer familiarity with a technology is rated very high, since this will have a direct relation to how efficiently programmers can write robust code.
Ajax- Virtually all web developers have good knowledge of the fundamentals of Ajax development: Javascript, HTML, JSON, XML.
Flex - There is a relatively low percentage of developers with hands-on experience with Flex.
Silverlight - While few developers have actually used Silverlight, version 3.0 and above supports all .NET languages, and development can be done directly in Visual Studio. For .NET developers the transition should be relatively easy.
Productivity ToolsClearly more powerful and useful productivity tools available is a substantial plus. All 3 technologies have a good story here.
Ajax – Lots and lots of tools in the Ajax space: intelliJ6+, Eclipse, Firebug, etc.
Flex – Flex Builder is a powerful (if sometimes clunky) IDE. IntelliJ also has support for Flex.
Silverlight – Uses Visual Studio, and all the power that comes with it.
Availability of technical supportHaving responsive support to address issues and questions is very useful.
Ajax – Most support is typically via forum posting. If a commercial toolkit is purchased there may be further support options.
Flex – With the Flex Builder purchase technical support is available, both for the IDE and Flex development generally. There are additional support packages that get quicker and more complete assistance with issues (
http://www.adobe.com/support/programs/flex/?tab:plans=1)
Silverlight – MSDN support, plus standard support packages.
LicensingThis criterion is meant to capture any possible conflicts that might arise between an open source or commercial license and TH software.
Ajax – Need to evaluate any open source licenses on a case by case basis.
Flex – The SDK is MPL, but anything built on top of it is not bound by the license (like Java).
Silverlight – Commercial software, unlimited use.
Cost
Ajax – Most libraries are open source and free
Flex – The SDK is free, although strong incentive to buy the Flex Builder IDE (Standard Edition $249, Professional Edition $699)
Silverlight – Requires Visual Studio (~$249 Standard Edition)
Ease of installation
Ajax – No installation. All current browsers with javascript enabled support Ajax calls.
Flex – Virtually every browser has Flash installed. Users may need to be upgraded to the latest version, but this is straightforward and causes few concerns.
Silverlight – Few browsers have Silverlight installed. While installation is a simple process, users and/or IT may have concerns about installing a relatively unknown plugin.
Support for advanced visuals/multimediaThis category captures sophisticated video integration and graphics manipulation, scalar vector graphics, etc. This is rated very low, although there are some examples of where BI vendors have used these capabilities to create attractive interfaces (e.g. Business Objects:
http://information.ondemand.com/istore)
Ajax – No.
Flex – One of the core strengths.
Silverlight – Also a core strength, plus excellent support for scalar vector graphics.
Local file storageThis could be very useful to create a quick and responsive application. We could choose to store things like subset/measure/attribute lists and other metadata locally, for example, to allow instantaneous load.
Ajax – Using a cookies can store up to 64K.
Flex – 2G is available by default. Unlimited file space can be requested.
Silverlight – I believe Silverlight is similar to Flex here.
Workflow support
This category captures development workflow. I.e. the people designing the controls, layout, look & feel are often different than the ones wiring up events and defining behaviors.
Ajax – I haven’t been able to find any tools that target this sort of support.
Flex – Flex Builder includes a fairly intuitive IDE for design and layout.
Silverlight – Includes 2 separate IDEs, one for designers (Espresso Blend), and one for developers Visual Studio.
Performance (JIT compilation)
Ajax – Javascript is interpreted script in all browsers (except for Firefox 3). This results in significantly slower performance than Flex or Silverlight, which are byte compiled. There is a great demo showing relative performance at
http://on10.net/Blogs/tina/microsoft-silverlight-chess/. It shows Silverlight evaluating 1 million+ nodes compared to ~1000 nodes in Javascript, using the same chess playing algorithm.
Flex – Byte compiled, fast runtime.
Silverlight – Byte compiled, fast runtime.
Real-time messagingPushing information to the client has traditionally been a difficult problem with Web based development, since HTTP is a request/response protocol. There is often a strong need to do this, however. For example, to inform a user that a report has finished.
Ajax – There are a few “hack” options to get around HTTP. For example, the “Comet” approach involves the browser making a request, then having the server hold it open for as long as possible, responding at the point it wants to send a message. These sorts of options are clearly sub-optimal.
Flex – Flex Data Services will attempt to establish a non-HTTP connection, at which point true server push is possible. If not, it falls back to one of the HTTP “hacks” like Comet. The SDK makes explicit provisioning for doing this sort of communication.
Silverlight – I couldn’t find documentation, but I heard from a Silverlight guru that there is a similar capability to Flex.
508 ComplianceAjax – Making Ajax applications 508 compliant can be complicated by the fact that screen readers cannot interpret partial-page refresh.
Flex – Many of the standard Flex controls have built in support for accessibility. Also, Flex inherits all the accessibility advantages of Flash Player 7, including support for Microsoft Active Accessibility (MSAA) (see h
ttp://www.adobe.com/macromedia/accessibility/features/flex/overview.html).
Silverlight – Poor accessibility in 1.0, has many new capabilities to better support 508 in 2 and above.
Text quality
Ajax – HTML rendered within a browser has very high text quality.
Flex – Flex 1.0 had somewhat poor text quality, font rendering has improved substantially in 2 and 3.
Silverlight – Has good font rendering.
Control set
Ajax – There are many, many Ajax libraries with large and robust control libraries.
Flex – Flex has a large set of standard controls, plus a set of advanced charts and controls that come with the professional license.
Silverlight – The current version of Silverlight has a relatively poor set of controls. The library seems best tailored at this point for multimedia applcations.
Charting/Grid components
Ajax – There are commercial and open source grid controls available in the Ajax space. Many I have seen appear to have good features and are powerful, although they may have performance issues with large sets of rows. Some Ajax toolkits include charting as well, although charting is typically done either server side or within a Flash player (e.g.
http://www.zapatec.com/website/main/products/grid/demo.jsp#countries.html)
Flex – Charts and Grids are Flex’s bread and butter. See
http://examples.adobe.com/flex3/devnet/dashboard/main.html. One notable control is the OLAPDataGrid, which we might be able to take advantage of.
Silverlight – There are some charts and grids being developed by outside parties for Silverlight, but the standard control set is still pretty limited.
Printing
Ajax – Ajax printing is bound by the same limitations as any HTML printing.
Flex – There is much more control than in the HTML world about how content is rendered on a printed page.
Silverlight – Similar to Flex, Silverlight includes a printing API.
MaintenanceThis category captures how well the technology supports well structured, maintainable code.
Ajax – Javascript supports writing maintainable code, it requires a fair amount of discipline by the development team.
Flex – Flex code structure encourages practices which aid in writing reusable and maintainable code. It has a clean separation between presentation (.msxml files_, which contain the control definitions and layout, and the action script files which define logic. Custom composite controls can be easily defined by creating separate msxml files.
Silverlight – Similar in many respects to Flex in terms of structure.
SecurityIn the Web 1.0 world developers were starting to get a good handle on security. It was understood that any information posted within a web app needs to be thoroughly validated server side to guard against any malicious requests. Also, it was clearly understood that any information passed to the client would be accessible to the user, so you can’t count on sensitive data like usernames/passwords being hidden.
With RIA some of these rules seem to get forgotten. Across all technologies it is common for controls to support sophisticated client side validation. This is useful, but not sufficient for security.
Also, with communication happening asynchronously, passing objects rather than documents back and forth, it is easy to forget that intercepting and deciphering these objects is trivial.
Unfortunately, I haven’t seen anything in any of the technologies which attempt to formalize security practices. For example, Flex and Silverlight could have options to encrypt objects (not only “across the wire” but up to the point where the application de-serializes the object.
Support for Functional testingAjax – There are several functional testing frameworks that work well in the Ajax space, including Selenium and Sahi.
Flex – New frameworks, including RIATest (
http://riatest.com/) are available.
Silverlight – Need more info here, but my understanding is that the MS functional testing framework works with Silverlight.
Support for Unit testingAjax – New tools like JSUnit can be used to unit test Ajax code.
Flex – Visual FlexUnit
Silverlight – The standard options in the .NET space work here: NUnit, NMock, etc.