Emilio Suarez's WebLog

Tuesday, May 01, 2007

GWT and Flex

With the announcement by Adobe that it is open sourcing the Flex SDK and also the official announcement from Google that the Google Web Toolkit is also under the Apache license, the playing field for building Rich Internet Applications is getting more interesting. Although Laszlo has been the open source leader for building Flash based applications, and there are a number of Ajax toolkits, Flex and GWT have two big corporations behind that are betting on them.

So which one should you choose? Do you need them? what is so special about them?

Flex - is a development framework for building web applications that are executed in the browser by the Flash Player. which is installed in more than 90% of the browsers, and those who don't have it, the installation is a breeze. But the most important feature is the ease of development. Flex applications are written in MXML which is an XML-like language that defines the components, layouts, panels, communications protocols, etc. and with tools like Flex Builder (which is not free) the development of application is simplified. The Flex Platform also provides more advanced features for enterprise applications for connecting to databases, displaying complex graphs and more, but the basic SDK is free for developers to build and deploy in commercial applications.
The one big drawback with Flex is that it is Flash in the end, and that breaks somewhat the browser experience that one expects from a web-based application. Is this bad? maybe not, it is just different.
With the release of the Apollo project also as open source, Flex applications now benefit with the possibility of being created to be used online and offline, meaning that the same application can behave the same whether it is connected to the backend server, or not, synchronizing automatically when the network is available.

- is a Java development framework that uses a Swing-like structure for building a user interface. There are components, events, layout managers, etc. and they are all written in Java, but then GWT compiles the Java code into JavaScript which is what is ultimately rendered in the browser. So what is so peculiar about this approach. "It's all about the tools dude!". The ability of creating your application in Java using top of the line IDEs, debuggers, frameworks and all the tools around the Java ecosystem, leverages the millions of people who are very experienced Java developers, and takes the complexity out of writing JavaScript. GWT is the outcome of the frustrations and pains that Google suffered when building Gmail and Gmaps. So they are not betting the farm on the GWT as the platform where JavaScript applications are now written and they have released it to the public to use.
As opposed to Flex, GWT renders in JavaScript, so it blends very nicely with the look and feel of regular web-based applications. It is even possible to embed portions of GWT widgets on any type of web application, regardless of the Java technology used (Struts, JSF, Tapestry, WebWork, JSP, etc.) so you don't have to buy in completely on redesigning your application to use GWT.

So there you have it. No more excuses to have a crippled web application with 10 year old user interface functionality. Now you can have the best of both worlds: desktop-like functionality and responsiveness in a distributed server-based web application.

Check out the sample applications for both Flex and GWT where they showcase the components and widgets they have and to have a taste of what the applications look like.