Slashdot Mirror


Is the Google Web Toolkit Right For You?

An anonymous reader writes "The recently released Google Web Toolkit (GWT) is a comprehensive set of APIs and tools that lets you create dynamic Web applications almost entirely in Java code. However, GWT is something of an all-or-nothing approach, targeted at a relatively small niche in Web application development market. This article shows you what GWT can do and will help you decide if it's the best tool to use for your web development."

35 of 163 comments (clear)

  1. Google takes more ground... by utopianfiat · · Score: 5, Funny

    I, for one, welcome our weather-reporting overlords.

    --
    +5, Truth
  2. Mingling of server and client code is "unusual"? by xxxJonBoyxxx · · Score: 4, Insightful
    "The GWT takes an unusual approach to Web application development. Rather than employing the normal separation of client-side and server-side codebases, GWT provides a Java API that lets you create component-based GUIs and then compile them for display in the user's Web browser."

    I think that's how ASP.NET components have worked for years too. So, I wouldn't say that it's unusual unless you're coming from a completely "my text editor is my development environment" world.

  3. Does it have an "I'm feeling lucky" feature? by purpledinoz · · Score: 5, Funny

    Does it have a "I'm feeling lucky" feature, where it will deploy your project for the first time without bugs?

  4. Short answer: No. by xxxJonBoyxxx · · Score: 2, Informative
    GWT does have a couple of fairly significant flaws. First among them is its lack of provision for graceful degradation. Best practice in modern Web application development is to create pages that work without JavaScript, and then use it where available to embellish and add extra behavior. In GWT, if JavaScript isn't available, you won't get any UI at all.

    In other words, if you want to make sure your site "just works", GWT isn't a good technology to use. If your management team is paying attention, that should pretty much stick a fork in this technology.

    1. Re:Short answer: No. by misleb · · Score: 2, Interesting

      I think the policy of graceful degradation has gone way too far when it comes to the web. I think it is just fine to assume a client has Javascript. Javascript is far too valuable when it comes to writing sophisticated web apps to work without it. It multiplies the workload on coders and it dumbs down the applications. And for what? Cell phones with an incomplete web browser? The 1% of users who are too paranoid to allow Javascript? Screw 'em. If they want to cripple their browsing experience, that is their business. Why should everyone else suffer?

      Of course, i depends on the application. There are cases (most cases?) when Javascript really does nothing but add "flare" to a site which would otherwise work fine without JS. But then there are some apps which actually leverage JS to work around the significant limitations of HTML/HTTP. The latter is becoming more and more common.

      -matthew

      --
      "THERE IS NO JUSTICE, THERE IS ONLY ME." -Death
    2. Re:Short answer: No. by morgan_greywolf · · Score: 2, Insightful


              GWT does have a couple of fairly significant flaws. First among them is its lack of provision for graceful degradation.


      In other words, if you want to make sure your site "just works", GWT isn't a good technology to use. If your management team is paying attention, that should pretty much stick a fork in this technology.


      Why? You can still do graceful degradation -- Google does this with it's own properties. Turn off Javascript and go visit Google Maps or Gmail. You'll get a 'non-interactive' version of the Web page. They just develop it two different ways, detect JavaScript, and then go to the appropriate version. What's wrong with that? It's a perfectly valid development approach.

    3. Re:Short answer: No. by big_gibbon · · Score: 4, Insightful

      Disabled users? Blind users? Screw 'em. If they want to be cripples, that is their business. Why should everyone else suffer?

      Ever think that it's not always someone's *choice* whether they can use JavaScript enhancements?

      P

    4. Re:Short answer: No. by SashaMan · · Score: 2, Insightful

      Like many slashdot replies, the parent is only thinking from a consumer website point-of-view. A huge market for this technology is corporate web applications where the company can dictate browser support (and "you must have javascript enabled" is a pretty minimal requirement from the corporate application perspective). Company XYZ doesn't care if it's sales quoting app doesn't work in lynx.

    5. Re:Short answer: No. by Steffan · · Score: 3, Insightful

      I disagree with your assertion. I often use lynx (a text-only browser) to access sites, both internal to my company and externally. Sometimes when you are connected via an SSH connection, console is all you have. It is very annoying to me when sites make use of javascript as the only method of navigating a site, especially when it detracts from normal functionality. It is not that difficult to make a very basic site that allows for at least a minimal level of functionality to a text-based user.

      Don't even get me started on *flash* sites...

    6. Re:Short answer: No. by Rogerio+Gatto · · Score: 3, Insightful

      I really think the problem is on screen readers/browser interface. Can't they monitor DOM changes and read the new content, or signal that some part of the page changed and prompt the user if it should be read? I believe that there's enough technology to do that already. If there isn't, it should be built. Javascript and DHTML can be made accessible if screen readers learn how to handle them. I just don't think it's fair to non-disabled users that javascript/DHTML should not be used because screen readers can't read them.

  5. Huh? by r00t · · Score: 2, Funny

    You haven't seen bad OO code? (maybe YOU'RE the bastard who writes it) You don't know how to write good non-OO code? It exists.

    There is an OO equivalent to spaghetti code, and it's fearsome.

    1. Re:Huh? by neonprimetime · · Score: 2

      I think you're confusing yourself ... I didn't say anything to the effect of non-OO code being bad ... or OO code always being good ... basically ... I personally find it much easier to write clean code in an OO language like Java ... than in a semi-OO lanaguage like C or C++ ... With C / C++ there are so many tricks, shortcuts, and multiple ways of doing things that I always end up finding myself writing obfuscated code ... where as in Java, I find myself sticking to a standard format ... where everything looks similar. That said ... I've been around programming long enough (I've even taught, C, c++, and Java courses), so I've seen the good, the bad, and the ugly in all languages.

  6. Feeling Inadequate by ruben.gutierrez · · Score: 2, Funny

    I had to stop after the third line... "Level: Advanced"

  7. Re:Mingling of server and client code is "unusual" by hey! · · Score: 2, Interesting

    I think that's how ASP.NET components have worked for years too.

    Not to mention EchoPoint.

    It's a good idea, but the devil is in the details.

    App developers are overwhelmed with details they have to manage. And we all know that the essence of good design is not having to worry about details until the appropriate time. The flip side is when you do focus on some other details you'd been ignoring up to this point, you don't want to have to worry about details you've already taken care of.

    So, the idea is that programmers should be able to program with your framework without worrying that they are doing something web based. That's good. But the flip side of that is that designers should be able to design without worrying about the fact the programmers are using your framework.

    The problem with past attempts at this paradigm fall short of ideal because they enforce non-standard or proprietary ways of doing things. They may be good enough, but they could be improved on.

    --
    Post may contain irony: discontinue use if experiencing mood swings, nausea or elevated blood pressure.
  8. Re:When I hear OO ... When I hear Java by stratjakt · · Score: 3, Informative

    When I hear someone say what you said I think... "another hack who's never programmed anything, never will, but read some shit on slashdot about it and now believes he's an expert"

    There's plenty of unreadable, unusable OO code out there, as well as plenty of well performing Java.

    --
    I don't need no instructions to know how to rock!!!!
  9. haxe by ncannasse · · Score: 3, Interesting

    There's been several JS code generators recently. Apart from GWT there's also haXe which is more ambitious. haXe can also be used on the Server Side and includes some facilities for Dynamic programming (whereas Java is strongly typed 100% of the time).

  10. Accessibility? by metamatic · · Score: 5, Interesting

    Also, what's the state of the art in screen readers? Do they have sufficient JavaScript support? (*)

    If not, using GWT for a corporate web site is just a lawsuit waiting to happen.

    (*) This is not an idle question, I'm sincerely interested in real answers and pointers to software.

    --
    GCHQ Quantum Insert installed. If only our tongues were made of glass, how much more careful we would be when we speak
    1. Re:Accessibility? by xxxJonBoyxxx · · Score: 5, Informative

      If I had mod points today, I'd boost you up. If you go by the ADA provisions*, I think you need to provide enough content in plain old HTML code and text (Javascript doesn't count) so that all the content is available inline and enough links, text boxes and other items (also in plain old HTML code) so that someone can navigate your entire site without any Javascript.

      *Section 508 Standards for Electronic and Information Technology;
      SubSection 1194

  11. Re:GWT feels like GUI programming by stratjakt · · Score: 2, Informative

    That's because that's what it is.

    From TFA: GWT essentially exploits the browser as a run-time environment for lightweight GUI applications, and the result is much closer to what you might develop with Morfik, OpenLaszlo, or even Flash, than to normal Web applications

    It seems more suitable for client development in intranet-type situations, rather than for stuff to go on the web at large. GWT is walled off from the traditional web page, it seems, and the article says there's no way to take values out of widgets to use in a form submission.

    It's interesting, the company I'm working for finally caught "browser based applications" fever, and this is another possible platform we could use. Of course since we aren't a Java house, we'll end up using ASP.NET.

    --
    I don't need no instructions to know how to rock!!!!
  12. YAHOO UI Toolkit by Foofoobar · · Score: 4, Interesting

    We've already got an MVC LAMP architecture here at work and I have limited Javascript development until the framework was further along. But now the designers are getting edgy because I won't let them incorporate Javascript.

    My issue was that I wanted a unified javascript library so we didn't have redundant code snippets all over the place and some way to standardize the development. So after a little searching, I found the Yahoo UI toolkit that is still in beta. It's a unified javascript library released under a BSD license that has been tested in multiple browsers.

    No I have a unified library, tested in multiple browsers and standardized that all I have to do is drop into a directory and hook into the framework.

    I know this is probably unrelated but since we were talking about toolkits, I thought this would be handy to mention this as well since it saved us a month of work.

    --
    This is my sig. There are many like it but this one is mine.
    1. Re:YAHOO UI Toolkit by Reality+Master+101 · · Score: 2, Interesting

      Google gets the lion's share of publicity, but there are a lot of AJAX toolkits out there that do a lot of the grunt work. I've been thinking about using some AJAX in a project I'm working on, and Yahoo was definitely one of the ones I'm considering. The "Sajax" one also looks interesting.

      --
      Sometimes it's best to just let stupid people be stupid.
  13. Re:Mingling of server and client code is "unusual" by Hoolala · · Score: 2, Informative

    There are developers who still use VI for Web developments :)

    GWT is the heavy favorite to serve as the core for our new webapp.

    ====

    Beaches & Casinos: http://buddytrace.com/

  14. Re:When I hear OO ... When I hear Java by frantzdb · · Score: 3, Insightful
    What do you think when you hear "Code Generator?"

    When I hear "code generator", I think compiler.
  15. Why not learn the tools instead by Anonymous Coward · · Score: 5, Insightful

    Hmm, all the examples in the article look pretty much the same than they were written in JavaScript, but in a more complex way. Why not actually learn the trade. Its easier to fix problems if you're working with the actual code that runs in the browser, not the "meta code".

    1. Re:Why not learn the tools instead by richdun · · Score: 5, Insightful

      Almost modded up, but hopefully someone else will take care of it for me.

      Expanding on parent's point, a lot of problems I see in my short time in web development is that too many people are getting into it not by learning basics (like how to build a well-formed XHTML/HTML document with DTD and such, or how to make an image swap sources onmouseover or whatever) but by diving straight into frameworks. I understand the want (and need, in some case) to make programming of all flavors more non-programmer friendly, but without that base foundation we'll end up with a bunch of forums full of "how do i make it do this" questions that are elementary in nature and, even worse, a bunch of web apps that are riddled with problems in security, UI, or other. There's no harm in asking questions, but when everyone is asking the same question that is answered in chapter 2 of any good HTML book, that's a lot of wasted time.

      I'm not saying everyone needs to learn how to build Slashcode from the ground up using only Notepad, Mountain Dew, and a bag of Doritos, but learning the basics first then going to a framework to speed up your work on complex projects would seem like a better option. It will almost always be cheaper and faster to write simple things in the base language, but so many are so fixed on frameworks they wouldn't know how to do that.

  16. Article misses the point a bit? by Penguin+Programmer · · Score: 4, Informative

    I would never, ever, ever even _think_ of trying to write an Ajax application. I hate javascript way too much for that, and the whole asynchronous web-page dynamicness scares the shit out of me. However, I can stand writing GUI code in Java, and I already have some knowledge of how it works. GWT enables me to write super-cool Ajax websites without worrying a bit about javascript. I think this is the true power of GWT: it enables _application_ developers (rather than web developers) to write nice web applications without learning a whole new skillset. This is a win for developers because we can do cool things without learning a whole new trade, and it's a win for consumers because web apps can be written by skilled application developers instead of photoshop gurus.

    Also, just because GWT provides some server-side machinery doesn't mean you have to use it. GWT will happily make asynchronous calls to any old URL, so you can write your backend in PHP or Perl or C or whatever you like. Personally, I've been playing with GWT using PHP/SQLite as my backend (following Juan Hurtado's great tutorial). It works great, and since I'm already comfortable with Java, PHP and SQL, it doesn't require a steep learning curve to create very nice web apps.

    That said, I will certainly be taking a deeper look at TFA later and perhaps following its example to learn how to use the Java server-side machinery. Could be interesting.

  17. GWT vs. Echo2 by arigi · · Score: 3, Interesting

    This seems like a useful article. At work we were just discussing the possibilities of using the GWT. Currently we use NextApp's Echo1 and are also pondering upgrading to Echo2. The demo app for Echo2 is actually mighty impressive; I'd say moreso than GWT's. Though I wonder how much of it is just more time spent on fancy graphics as opposed to a better quality framework.

    1. Re:GWT vs. Echo2 by distributed · · Score: 2, Informative

      The team I used to work for 3 years ago wanted a web gui layer framework similar to this back then.. and i remember Echo 1.x was one of the first ones we prototyped. Then there also was millstone http://www.millstone.org/ And i think echo was also featured on slashdot http://developers.slashdot.org/article.pl?sid=03/0 9/09/2337216
      Echo 2.x seems to have now added support for ajax.. a demo is available here: http://demo.nextapp.com/Demo/app ..and it runs smoother than the ajax controls found on flickr atleast. In the end it seemed that the world wasnt ready for this... and higher management didnt like the risk associated with trying something completely new.

      --
      [all generalizations are untrue except this one]
  18. Why GWT Isn't A Good Framework by WombatControl · · Score: 4, Interesting

    As a disclaimer, I'm a huge fan of Ruby on Rails, and not at all a fan of Java.

    The problem with the GWT and other framworks like it as it ignores the reality that browsers today suck. IE's rendering engine is suckier than Monica Lewinsky holding a Dyson at the event horizon of a black hole. Firefox doesn't quite yet pass Acid2, but is as close to a reference platform as one can get. Safari shows promise, but it has a weak JavaScript environment that doesn't support things like ContentEditable. The whole problem is that the GWT assumes a much more stable platform than actually exists.

    The real challenge for web application developers is that there are no frameworks (that I know of) that provide for things like fully semantic code, graceful degradation of capabilities, and full separation of content, behavior, and presentation. (For why that separation is important A List Apart has a great article on the subject.) Not even Ruby on Rails gets this right by default.

    GWT tries too hard to abstract the actual code that user agents see from the code the programmers create - and that level of abstraction just doesn't work yet. Just like trying to translate a passage in French to English and Japanese with a machine translator, the GWT tries to take Java code and translate it into a mish-mash of XHTML, CSS, and JavaScript - and the results are as mangled as one would expect.

    Until someone comes along with a framework that creates clean, semantic code with full separation of behavior, presentation, and content, web application developers have to be mindful of their code and do a lot by hand. Frameworks can save time, but they also cause a trade-off in terms of code quality and compatibilty. The GWT goes too far in that balance IMHO, and isn't something I'd use to develop public applications. Like ASP.NET, it's too reliant on abstracting XHTML/CSS/JavaScript from what the programmers deal with, and that always leads to bloated masses of code that frustrate users and hog bandwidth.

    1. Re:Why GWT Isn't A Good Framework by kevin_conaway · · Score: 3, Insightful
      IE's rendering engine is suckier than Monica Lewinsky holding a Dyson at the event horizon of a black hole

      Mod -1: Trying too hard.

      Seriously though, you say GWT tries to take Java code and translate it into a mish-mash of XHTML, CSS, and JavaScript - and the results are as mangled as one would expect. and then go on to say Until someone comes along with a framework that creates clean, semantic code with full separation of behavior, presentation, and content.... Isn't that kind of contradictory? If its spitting out xhtml, css and javascript, that seems like content, presentation, and behavior are all clearly defined.

    2. Re:Why GWT Isn't A Good Framework by Jobe_br · · Score: 3, Insightful

      OK, ignoring the fact that GWT uses Java as its initiation language (it could use Ruby or C++ or PHP) - I still have to disagree on a number of points.

      The problem with the GWT and other framworks like it as it ignores the reality that browsers today suck.

      Right, which is why something like GWT is nice because you don't really care that the browser sucks, you write your code and it works. Graceful degradation isn't really an issue in this case ... GWT supports a number of browsers identically (i.e. your code will run identically to the end-user). If you're looking for graceful degradation to plain HTML w/o JS, then that's a bit of a pipe dream, since you're not talking the same application. That's analagous to writing a GUI app (on Windows or OS X or Linux/GTK/Qt) and having it gracefully degrade to a console application. Last I checked, anything that's more than a simple app doesn't do anything like that, and for good reasons. Endless backwards compatibility is a case of diminishing returns and while it may be "nice", it isn't practical or economical.

      GWT tries to take Java code and translate it into a mish-mash ... and the results are as mangled as one would expect.

      Um, no. The results are a web-application that functions as you would expect. It is unknown if Google Calendar or Google Spreadsheet are using GWT, but according to Google, the pain they experienced writing Google Maps & GMail played a part in developing GWT - so those types of applications are certainly on the drawing board for GWT. I wouldn't call those apps mangled or anything along those lines. They're quite possibly best-of-breed.

      I also disagree that Google's approach with GWT:

      ...always leads to bloated masses of code that frustrate users and hog bandwidth.

      On the contrary, I think in reality, hand-coding, by the masses of programmers that cannot be experts at JavaScript and Browser Nuances, has already created bloated masses of code that not only frustrate users & hog bandwidth, but are also difficult to maintain, practically impossible to debug effectively, and a huge drain on an organization's resources. Its time to change that and I think GWT takes steps in the right direction. I haven't heard of masses of users being frustrated by Google Maps, Mail, or Calendar ... at least not because its bloated or hogs bandwidth.

  19. Why I like YUI by HotButteredHampster · · Score: 4, Interesting

    The two things I like about the Yahoo! UI toolkit are that:

    - it is a la carte
    - it represents pretty advanced, human-readable Javascript, which has allowed me to learn advanced Javascript techniques

    The first, a la carte, means that the entire web application does not need to be dedicated to YUI. Recently I incorporated a YUI DHTML window (Panel, in YUI-speak) into an existing ASP.NET application. It required only a few lines of Javascript and some HTML. Ditto for another application (JSF, this time), where I added an AJAX data lookup to dynamically populate sample values in a dropdown list. I love the DOM and Event libraries: they really clean up the cruddy job of adding small DHTML things to a website, regardless of how it's put together.

    The second, that YUI is a learning experience, is also very important to me. I've come late to the DHTML game, and most books and tutorials on Javascript deal with the basics, and stuff like OO programming is either glossed over or omitted entirely. However, Javascript is a language that is suited to OO programming in a unique way, IMHO. By studing how the YUI toolkit works and seeing what Javascript is capable of, it has opened the doors for new ways of tackling problems and reducing the number of lines of JS code I write.

    HBH

    --
    "Smart is sexy." -- D. Scully ("War of the Coprophages")
  20. Re:Mingling of server and client code is "unusual" by Alexandra+Erenhart · · Score: 4, Funny

    Now I understand why computer science geeks don't "couple". They have a whole different meaning of the word from the rest of the world ;)

  21. XML11 looks more promising by sproketboy · · Score: 2, Interesting

    Uses java byte code instead of source so it's more stable. http://video.google.com/videoplay?docid=-317158218 7051229467

  22. Google Web ... by kompiluj · · Score: 2, Funny

    Did you say "Google Web Rootkit"?

    --
    You can defy gravity... for a short time