This article opens a series of posts dedicated to Flex and GWT comparison.
Both are meant to help developers in construction of reach interface applications. Both achieve this goal in very different ways.
I will compare GWT and Flex because people who are familiar only with one of them have different thoughts on why they should/shouldn’t learn the other technology. They are asking questions like “I heard that Flex can be used in enterprise apps for UI with large amount of data. Can’t I do the same with GWT?” or “GWT allows me to have very responsive AJAX applications which are cross-browser compliant. Seems like Flex promises the same, is it worse to learn it?”.
I am writing this just for such developers to share my impression.
So let’s start from some history.
History
The next time-line shows how both teams where roughly releasing:

As you can see Flex team started ~ 2 years ahead of GWT team. Not surprisingly Flex is more mature technology at the current moment. The proper analysis maybe would be to compare then GWT 2.0 with Flex 2.x but no one is interesting in this
Out of the Box
Let’s see now what developers have out of the box when they start to work with both technologies.
SDK
Both have open source free SDK.
IDE
GWT: All you need is Eclipse with J2EE plugins + download and install free GWT Eclipse plugin.
It perfectly works even with latest Galileo (3.5) Eclipse.
Flex: Though basic tools to work in command line (compiler, etc.) are provided it will not be very convenient to do some real project given just that. Adobe Flex Builder 3 plugin for Eclipse is not free and costs some fair money but it is worth of its price, no matter what the people say.
Programming Language
You develop GWT projects on Java.
For Flex you need to code in Action Script.
Action Script provides majority of the OOP features and for a normal developer the learning curve should be very short.
Off course Java is richer language but Action Script provides you with all means to create a nice OOP code. Also consider that for the classes that represent your UI components and thus will be compiled to Java Script code by GWT you can use only part, though quite large part, of the Java Runtime Library. For example you can’t use threads or java.io classes.
UI Markup Language
GWT: Before the 2.0 release GWT has no embedded markup language. All structuring and layouting of your UI should have been done in Java code similarly as it is done in Java Swing.
As of the GWT 2.0 there is a UiBinder feature which allows you to layout/style your UI in xml files. I described basics of this here.
Flex: there is MXML markup language which also allows you to layout and style your applications/components in xml-way. But MXML is much more mature, allowing you to do additional things which you will not be able to achieve with UiBinder. For example you can insert plane Actions Script code there, so MXML’s flavor resembles here JSPs ![]()
Theoretically you can write the whole Flex application in MXML while UiBinder only allows you to control layout and assign some event handlers + other minor stuff.
Also it’s worthy to note that MXML has much stronger support in IDE: better autocompletion, ability to debug MXML, etc.
Standard Components
GWT: comes with 18 widgets and 10 layout panels which are described here.
Flex: has 30 controls, 17 Layouts, 8 Navigators and 10 charts. Though some useful enterprise-scale components are not coming in the standard free package and you should pay additionally for them, e.g. Advanced Data Grid or OLAPDataCube.
So here Flex and GWT hardly can be compared. Also upcoming (in 2010) Flex 4 release promise to deliver even more components.




Recent Comments