Thursday, April 10, 2008

Resistance to Using Flex

I am starting to hear Java developers other than the well-known Flex/Java developers (Bruce Eckel, James Ward, and Yakov Fain) and lesser known Flex/Java peers (Bill Jackson and Michael Martin) talk about using Flex in enterprise Java applications. It seems that at least weekly I hear directly or indirectly of a Java developer being pleasantly surprised by what Flex offers.

While many Java developers seem to be investigating and adopting Flex, there still is a large contingency that cringes at the thought of Flash. I think that some of them let previous abuse of Flash in web sites keep them from seeing the virtues and values of Flex. It is easy to forget that just because a technology can be misused or abused, this does not necessarily mean that it cannot be effectively applied as well. There are plenty of examples of bad things that can be done with any programming language. The key for me is what can I do for my customers with a particular language. I have found that I can create richer web experiences more easily with Flex than with any other framework that I have tried.

Besides negative user perception of Flash from previous slides that misused or abused Flash (which we don't have to fall into when using Flex), what are the other reasons that some Java developers resist use of Flex for rich web applications? The general reasons seem include fear that Adobe will treat Flex like it treated SVG; concern about using "proprietary" Flex versus standardized web technologies like HTML, CSS, DOM, JavaScript, and XML; inability to use the Back button, bookmarks, and other browser capabilities; problems being adequately covered by search engines; and cost. In the remainder of this blog entry, I'll attempt to demonstrate that these concerns are overstated or, at least to me, seem manageable now.

While it does appear to many of us as if Adobe has abandoned or at least changed course dramatically in relation to Scalable Vector Graphics (SVG), I think their support of Flex may be a different story. There are several differences including the seemingly greater support for Rich Internet Applications (RIAs) in general than SVG enjoyed, including wider community and wider availability of books and literature.

Very few web developers have the stomach to use the underlying Ajax technologies of CSS, HTML, DOM, JavaScript, and XML directly and without use of a third-party library or framework. Even when these third-party libraries are open source and freely available, they still require our code to meet certain API expectations. Now that Flex 3 SDK is open source and freely available, it is increasingly difficult to see how using of third-party Ajax framework is much "safer" than using Flex. The other thing I don't think Java developers realize is that Flex is based on standards as well. Flex code consists of an XML grammar (MXML) with an implementation of ECMAScript (ActionScript 3.0). I personally find the ActionScript 3.0 implementation of ECMAScript to be much nicer to use than JavaScript implementations of older versions of ECMAScript.

Some people worry that developers will need to learn "whole new languages," but my experience was that my previous experience with JavaScript and XML made learning and applying ActionScript and MXML easy. My Java experience was valuable in easily migrating to Flex as well because Flex adopted many Java-isms like asdoc (think Javadoc for ActionScript), many syntactical similarities, and Java-like class-based object-oriented features.

For my primary uses of Flex, the limitations surrounding use of browser features like the Back Button, bookmarks, and so forth have not proven significant in most cases. The whole idea behind an RIA seems to move the user away from these types of approaches anyway and some of them can be simulated. It is also worth mentioning that many Ajax solutions can suffer these same limitations.

The problem of having a Flex-based Flash application being listed by search engines can be an issue for sites that depend on search engine traffic. As discussed in How to SEO Flash, there are ways to address this to some degree.

As stated above, the Flex 3 SDK is freely available, so previous complaints about the cost of Flex aren't really stated as much now.

Adobe has apparently invested significant resources into making Flex appealing to Java developers. Evidence of this include the Adobe Developer Center focus on Flex and Java and the fact that Adobe has made BlazeDS available, allowing for Java-specific client-server communication mechanisms. Prior to BlazeDS, Java developers could use the free Flex SDK to communicate from the browser to server-side Java via HTTP (servlets when in Java on the server-side) or via web services. However, these approaches could be used with non-Java server-side technologies as well. BlazeDS offers more freely available communication mechanisms including faster-performing Java-specific mechanisms.

If one needs more evidence of the powerful combination of Flex with Java EE, one need only look at Microsoft's interest in Silverlight and Sun's interest in JavaFX to see that these two companies also see the value.

No comments: