GWT vs Flex vs?

17,679

Solution 1

I'm only mildly familiar with Flex, but have worked with GWT for many years. We had to make a very similar decision some years ago (Flash vs GWT), but for different reasons. In the end we saw the many advantages of GWT over Flash (Many of which apply to Flex):

  • Not all our customers have flash, penetration numbers from Adobe are useless, you need your own (which we have) to see what your customers actually have. In corporate and education markets the penetration is actually far lower than the high 90s that Adobe quotes.

  • GWT is truly cross-browser and platform compatible (Linux, Mac, Windows, Android, iPhone, etc, etc) whereas flash will never be. You may not care about that, but we did.

  • Flex is proprietry Adobe Technology, whereas GWT is fully open source and customisable

  • GWT integrates with the DOM, and everything else on your page far easier than flash and Flex do.

  • GWT is coded in Java, and we all know Java extremely well

To Address your specific points:

*  futureproof

Nothing is truly future proof, but I feel that both GWT and Flex would be fairly future proof. Maybe GWT a tiny bit more so because it's open source.

* works on all major browsers

GWT works in Firefox(and all gecko browser), Safari (and all Webkit browsers), IE and Opera. Flex works in all browsers, but only if Flash is supported, so I would say GWT comes out on top there.

* fast & responsive user experience

On platforms where it's supported, Flex is going to kill GWT dead for user experience. You just can't compete with flash when it comes to smoothness and slickness.

* code should be unit testable

Both are easily unit testable

* code must be maintainable

When coded well both are maintainable

* speed & ease of development

As long as your familiar with them, I'd say it's much of a muchness.

* supports vector graphics of some sort (SVG a plus)

I can't speak for Flex, but GWT supports vector graphics via SVG, through third-party libraries.

Solution 2

I'm not familiar with GWT, but I'm very familiar with Flex. Even though GWT is Java-based (and it sounds like you're largely a Java shop), I'd recommend Flex based on your listed interests:

  • Futureproof - Flash powers YouTube and a huge percentage of multimedia on the web... they've built it into video game consoles and Intel is building it into settop boxes. It's going to be here for a long, long time, and Adobe has always maintained 100% backwards compatibility with their Flash players.

  • Works on all major browsers - yes. And with Flash Player 10, that includes Linux systems as well. And with very minimal admin headaches (way less than Java, in my opinion).

  • Fast & responsive user experience - yes, though Java can be faster in some scenarios. Flash is optimized for vector rendering, so since that's your target, it may be give you better performance than Java.

  • Code should be unit testable - yes, see FlexUnit.

  • Code must be maintainable - definitely. AS3 is a serious language, not a toy scripting language. It will be very familiar to users of C# or Java.

  • Speed & ease of development - for what you're doing, you'll be able to find dozens of examples of exactly what you described: zooming and panning Google Maps -like vector images. The core of the runtime is a well-designed graphics engine, so building an interactive graphics app is its natural chore.

  • Supports vector graphics of some sort (SVG a plus) - obviously, Flash does this natively. SVG is supported at the compilation stage (you can compile in SVG but you can't parse SVG at run-time). There are toolchains available that'll convert SVG to SWF for you at runtime.

The only reason I'd see for using GWT would be to keep your shop Java on server and client... but then again, you're looking for the best tech for the job, right? In that case, I'd say Flash (and in particular, the Flex framework) is best suited for what you're wanting to accomplish.

Solution 3

I was part of a project that used GWT, and I loved it, especially since Java is my primary programming language of choice. I haven't used Flex, so I'm only giving you info on what I've experienced with GWT. To comment on some your requirements

*futureproof - GWT's been there for a couple of years already, and its continually supported by Google.

*works on all major browsers - if you've used GWT, cross-browser programming has never been much easier. GWT does this for you!

*code should be unit testable - yes you can unit test GWT, its also easy to debug GWT.

*speed & ease of development - Ajax is made a lot less complicated thanks to GWT. That alone could speed up your RIA development.

Aside from these, I just have to say, I love their Google Group! It's very active and you could find a lot of people out there that could help you out in case you get stuck with something.

Solution 4

Sun has recently launched a new technology called JavaFX for these kinds of RIAs. You may want to check it out (javafx.com). It is suppose to run on Java 5 or better but that will definitely not have the kind of client penetration that Flash does. I think however given your requirements for testing that this technology may not be appropriate at this time.

Also, I think Troy Gilbert made an error in his post. Specifically, he seems to indicate that a GWT application will run (by the client) in java. I'm almost certain that a GWT application is written first in Java and then GWT will compile that into a javascript library that the client runs.

Solution 5

I'm biased toward Flex since I've been doing Flash/Flex development since 2000. I think to answer your question though, it really comes down to the level of interactivity and complexity you want to achieve.

Flex is going to let you do things that would be nearly impossible in a JavaScript environment (ASP.NET AJAX, jQuery, GWT) such as simple 3d graphics. Building complex interactivity is really trivial in Flex. Also it is very fast and can handle lots of animated objects at a time. Flex can communicate seamlessly to .NET or Java using web services. The downside of using Flex is that it feels like an embedded application on your web site rather than something that is tightly integrated.

If you are going to stick with a JavaScript approach, usually I'd suggest using something language agnostic like jQuery. But since you already have GWT experience, that may work well for your project. The downside is that GWT in the end is still JavaScript, so you are going to be limited by the speed and interactivity of what is possible in a browser.

Share:
17,679
Limbic System
Author by

Limbic System

I'm a senior software engineer at a NJ-based firm, mostly working in Java. I've worked at startups, a telco, and even did a stint as a consultant in Europe for a few years. If you're in the Central NJ area, let's get together and have a beer! Contact is my username (minus the space) at gmail.

Updated on June 26, 2022

Comments

  • Limbic System
    Limbic System almost 2 years

    My company is trying to migrate away from a .NET application to something that is purely web-based, and very "ajaxy". The original .NET app is fairly interactive, roughly equivalent to Google Maps as far as user interaction is concerned (zoom, pan, annotate features on a vector map).

    Our .NET developer is really taken with Flex2. I'll admit to having a pretty strong Java bias. I also have about a year's worth of experience with GWT, and can get things done pretty quickly with it. Our codebase is mostly J2EE, so GWT seems a natural fit to me. I have zero experience with Flex, so I really can't make a recommendation for or against it

    Our primary interests in selecting a framework are the following:

    • futureproof
    • works on all major browsers
    • fast & responsive user experience
    • code should be unit testable
    • code must be maintainable
    • speed & ease of development
    • supports vector graphics of some sort (SVG a plus)

    Care to weigh in on the pros & cons of these two technologies, or even recommend a third option?

  • Lordn__n
    Lordn__n over 15 years
    Your understanding of GWT is correct.
  • cno
    cno over 15 years
    Comment to: "Fast & responsive user experience - yes, though Java can be faster in some scenarios." GWT produces JavaScript, not Java for the browser.
  • Daniel Vaughan
    Daniel Vaughan over 14 years
    Just wanted to pick up from your second point. GWT does not require Java installed on the client. The whole idea of GWT is that JavaScript is the output so that it can work in pretty much any browser without requiring plugins so no "admin headache".
  • kirushik
    kirushik over 14 years
    There IS 3d graphics support in GWT via code.google.com/p/gwt-o3d
  • SyntaxT3rr0r
    SyntaxT3rr0r about 14 years
    @Nail Visnapuu: GMail doesn't feel like anything other than a website? We're probably not visiting the same websites ;)
  • rlovtang
    rlovtang almost 14 years
    Flex supports vector graphics. Either the new open source FXG format (opensource.adobe.com/wiki/display/flexsdk/FXG+1.0+Specifica‌​tion), SVG or SWF.
  • Manius
    Manius almost 14 years
    Actually it doesn't. Just some fancy AJAX scripts and a bunch of JS that makes it run a bit slow (which is actually the performance you'd expect of a website). This answer has a lot of truth in it. Gmail IMO isn't as impressive as JavaScript advocates always like to brag it is. 99% of the time you're just there to view some mail, maybe reply to one or two, and leave. Nothing a basic "non-AJAXy" website couldn't handle perfectly well.
  • Manius
    Manius almost 14 years
    "Not ready for primetime"? That'll be interesting news to all the people using production Flex and Silverlight applications in the corporate world. "Native browser technology" cannot support "full-blown applications", all they do is run scripts which mock the behavior of an application--and they can never do it consistently or reliably. All the technology you're pushing fits the definition of a legacy system perfectly. en.wikipedia.org/wiki/Legacy_system
  • Manius
    Manius almost 14 years
    That is correct, and this of course means that GWT suffers from most of the same issues of any run-of-the-mill so-called "AJAX framework"--browser 'platform' dependency and exposure to a very dynamic, non-standard development environment. A Flex application runs in a Flash virtual machine which shields you from 99% of the problems associated with running on half a dozen different browsers.
  • Manius
    Manius almost 14 years
    "Works on all major browsers" - today that's not an issue, but if IEx (or any browser really) comes out, creates an issue which requires an update in GWT to fix--now your app is broken until you go through the possibly painful process of upgrading GWT. Ouch! GWT isn't quite as futureproof. "development & deployment costs" - Not so fast-- most don't use LCDS, they use OSS like GraniteDS or BlazeDS. Also Flex/Flash Builder are dog cheap in contrast to what it costs to EMPLOY your dev--a few hundred bucks for the IDE is nothing! Once you get the IDE everything is free from then on out.
  • Manius
    Manius almost 14 years
    "Works on all major browsers" - today that's not an issue, but if IEx (or any browser really) comes out, creates an issue which requires an update in GWT to fix--now your app is broken until you go through the possibly painful process of upgrading GWT. Ouch! GWT isn't quite as futureproof.
  • Manius
    Manius almost 14 years
    Scott, Flex or any other player/VM-based RIA tech may not be infinitely futureproof (what is?) but it's inescapably more futureproof, being shielded from 99% of the issues you can experience with non-standard browser environments.
  • Manius
    Manius almost 14 years
    "Works on all major browsers" - 'today' that's not an issue for GWT, but if IEx (or any browser really) comes out, creates an issue which requires an update in GWT to fix--now your app is broken until you go through the possibly painful process of upgrading GWT. Ouch! GWT isn't quite as futureproof! The comment starting "GWT is truly cross-browser and platform compatible" implying that Flex/Flash isn't does not come off completely honest. The only real compatibility issue is with crippled iProducts. But it's everyone's choice on whether to support Apple's anti-choice practices or not...
  • Tetaxa
    Tetaxa almost 14 years
    yeah damn those iProducts and there 100,000,000 user install base. You should just ignore them. That would be the right thing to do ;) Safari is a major browser. ANY browsers with 100 million users is a major browser. It's not Adobe's fault that Apple are being jerks about it, but that's the way it is ;)
  • Manius
    Manius over 13 years
    Apple needs to realize that they can't control this market. And by the way, Android is wiping the floor with Apple's proprietary stuff (if we're so concerned about such things). Why would you not be okay with the open source Flex SDK (and partially OSS Flash player), which is given out for free--just because it's proprietary... yet be fine with supporting Apple's proprietary, closed systems which they're trying to turn into a Microsoft-style semi-monopoly? I hate to be blunt but your whole post just comes off as very one sided.
  • Dutch Masters
    Dutch Masters over 12 years
    Crusader has the right username. Why keep pretending Apple doesn't exist? Thats like saying I won't support IE because it doesn't pass all its ACID tests.
  • Admin
    Admin over 11 years
    Who's pretending Apple doesn't exist? It's proprietary, and a smaller market than Android now. Also, based on stats I've seen, Flash is installed on more devices than there are "iDevices" out there, so the numbers aren't an entirely Apple run game (especially when you factor in Adobe AIR which is how you run Flex apps on iOS). But the more important thing is that Flex 5 will have HTML5 output support.