Sunday, June 3, 2012

GWT vs Flex vs?


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?


Source: Tips4all

13 comments:

  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.

    ReplyDelete
  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.

    ReplyDelete
  3. One other point to note is that neither the iPhone nor Android currently support Flash. A lot more people are expecting to access web apps on their phones.

    ReplyDelete
  4. 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.

    ReplyDelete
  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.

    ReplyDelete
  6. 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.

    ReplyDelete
  7. I've used both teƧhnologies for some time.

    Futureproof - both of them will be succesful i guess, but every technology will be prefered in different situations. For example flex in large (mostly intranet) enterprises with desired desktop like ui (Flex can be used on the top of the any server platform(jvm,.Net,php,ruby,coldfusion)). GWT otherwise will be dominant in small to medium app with traditional jvm backend (tomcat+spring etc.)

    Works on all major browsers - both are non-problematic in this way. Flex absolutly excellent, when flash plugin is installed there is not need to solve any cross-browser compatibility (of course... browser are passive, when flash app runs:). I remember we had some minor problems with GWT and tradional troublemaker IE6, but nothing horrible...

    Fast & responsive user experience - both are the top in their category. Flex i think absolutly the top of the all RIA solutions(maybe silverlight, java fx can be only competitors in richnest), expecially integrated with LCDS with cool features like data management, real server side data push etc. GWT is the one of the top in ajax framework category. The more richest and complicated ui you need, the more reasons to using flex you have. Intepreted javascript in any case can't be faster&responsive then compiled actionscript/swf.

    Code should be unit testable - yes, they are greatly testable.

    Code must be maintainable - both excellent, maintaining actionscript is comparable to java(gwt), if you use a good IDE for example Flex Builder.

    Speed & ease of development - both perfect if you know your staff. Everything depends of your backround. For typical java developer learning curve to flex will be probably a little bit more difficult(You need to learn a new compliler/runtime and probably new IDE or at least new eclipse IDE plugin:). Some knowledge of flash is a +, but not required and only usually with specific tasks like building your own components etc.

    Supports vector graphics of some sort (SVG a plus) - no issues I remember, i have no too much experience with this, but i will look at it in future when FXG will be finnalized.

    development & deployment costs - The winner is clear here. GWT. Flex was developed to make a profit. Although self is opensourced, best tools(Flex Builder, new Flash Builder/Catalyst) & frameworks(LCDS) are commerciall and not cheap at all. Look at LCDS per CPU pricelist and you will know what i'm talking about. With GWT most of the quality tools/frameworks are opensourced or free at least. Except some advanced components like ext gwt and smartgwt EE. Obviously u can live without them.

    ReplyDelete
  8. While iPhone and Android do not support flash YET, you should also note that Google create applications targeted for the mobile phone. They are doing that because the screen on mobile devices is vastly smaller then the typical laptop/desktop. Therefore, the lack of flash support is a non-issue, since a targeted app provides a better user experience.

    ReplyDelete
  9. My company was faced with the same decision about one year ago. Have you heard of GXT http://extjs.com/products/gxt/? We ultimately chose GXT. As a .NET developer, making the transition from .NET to GXT was great. We developed an corporate-wide management program with GXT/GWT. The downsides are that GXT is developed by a much smaller team compared to Flex and the community isn't near as large. However, it delivers an impressive in-browser experience. Check it out.

    ReplyDelete
  10. This really is an apples / oranges question. With GWT, you get the pureness of writing everything in Java. Ironically, the end result will never feel like anything other than a website.

    With Flex, you get to write something that feels like an application. And, perhaps most importantly, with Flex, there is NOTHING you cannot do programatically - whether functional or graphical.

    If you are developing applications for a specific user base, Flex is a winner by miles. If you are building a mass social web based whatever, GWT is definitely a better choice.

    ReplyDelete
  11. Future proofing is more about architecture than it is about a specific technology. With the right architecture you can pretty easily swap out presentation technology. I like Silverlight/MVVM although the pattern does require some planning to also support HTML5.

    ReplyDelete
  12. I liked the comment from kirushik claiming that "GWT has 3d support". Not so fast, let's be completely honest here. You need a special plugin to do this: "Requires Google O3D plugin download" OOps!

    Sorry this couldn't be a direct comment/response but I felt this was an important point that shouldn't be simply ignored, especially when so many JavaScript fanboys are out there howling about not wanting to use "evil" plugins... (The real reason they cry about this non-issue, particularly when corporations have total control over the simple task of deploying Flash on their private networks or not, is that they think it's an easy hit against Flex or Silverlight to help them promote their own skill sets.)

    ReplyDelete
  13. I know you asked about GWT vs Flex, but if you have a say over the final decision you should seriously consider whether to move away from AJAX and ASP.NET. Despite what Adobe, Microsoft, and Sun say, RIAs (Rich Internet Applications) are not yet ready for a primetime browser experience except in limited form (like video players).

    A full-blown application written for the browser, in native browser technology, is going to give the best possible experience to the user as well as having the most development resources available to maintain it.

    ASP.NET is not going anywhere. Neither is Java or Flex. But for sheer reach, best possible user experience overall, and maintainability (due to there just being far more available programming resources available) you cannot beat a native browser-based application.

    ASP.NET MVC is purely web-based and very Ajaxy. You might check it out. It is similar to Ruby on Rails (without the Rails) and developers (even devs new to ASP.NET) are quite taken with it.

    ReplyDelete