Stories
Slash Boxes
Comments

News for nerds, stuff that matters

Slashdot Log In

Log In

Create Account  |  Retrieve Password

Is the Google Web Toolkit Right For You?

Posted by CmdrTaco on Wed Jun 28, 2006 09:41 AM
from the sure-why-not dept.
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."
+ -
story
This discussion has been archived. No new comments can be posted.
The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More
Loading... please wait.
  • I, for one, welcome our weather-reporting overlords.
  • by xxxJonBoyxxx (565205) on Wednesday June 28 2006, @09:47AM (#15621025)
    "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.

  • by purpledinoz (573045) on Wednesday June 28 2006, @09:49AM (#15621050)
    Does it have a "I'm feeling lucky" feature, where it will deploy your project for the first time without bugs?
  • Short answer: No. (Score:3, Informative)

    by xxxJonBoyxxx (565205) on Wednesday June 28 2006, @09:53AM (#15621095)
    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.

    • Accessibility? (Score:5, Interesting)

      by metamatic (202216) on Wednesday June 28 2006, @10:12AM (#15621247) Homepage Journal
      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.
      • Re:Accessibility? (Score:5, Informative)

        by xxxJonBoyxxx (565205) on Wednesday June 28 2006, @10:24AM (#15621354)
        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
        • Well, I'm glad that someone finally provided a reference to this claim that Javascript is somehow prohibited by the ADA. But you have completely misreprsented what the regulations state -- there is NOT a prohibition on javascript navigation:

          When pages utilize scripting languages to display content, or to create interface elements, the information provided by the script shall be identified with functional text that can be read by assistive technology.

          So, basically your script navigation has to provide text l

    • Sounds perfect for intranet and extranet sites where you get to dictate the browser users may access the site with.
    • 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 thei
      • by big_gibbon (530793) <.moc.snavelihp. .ta. .todhsals.> on Wednesday June 28 2006, @10:59AM (#15621633) Homepage
        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
        • 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 read
      • by Steffan (126616) on Wednesday June 28 2006, @12:02PM (#15622144)
        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...
    • 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 'n

  • I had to stop after the third line... "Level: Advanced"
  • I mean, I tried to make it work, but I couldn't ever get her to give me a callback...
  • haxe (Score:3, Interesting)

    by ncannasse (976609) on Wednesday June 28 2006, @10:10AM (#15621226)
    There's been several JS code generators recently. Apart from GWT there's also haXe [haxe.org] 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).
  • YAHOO UI Toolkit (Score:5, Interesting)

    by Foofoobar (318279) on Wednesday June 28 2006, @10:15AM (#15621280)
    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.
    • Google gets the lion's share of publicity, but there are a lot of AJAX toolkits [ajaxlistings.com] 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.
  • by Anonymous Coward on Wednesday June 28 2006, @10:33AM (#15621445)
    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".
    • by richdun (672214) on Wednesday June 28 2006, @10:44AM (#15621534)
      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.
  • 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 [googlepages.com]). 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.
  • GWT vs. Echo2 (Score:3, Interesting)

    by arigi (932824) on Wednesday June 28 2006, @10:47AM (#15621560)
    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 [nextapp.com]. 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.
  • by WombatControl (74685) on Wednesday June 28 2006, @10:58AM (#15621626)

    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 [alistapart.com].) 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.

    • by kevin_conaway (585204) on Wednesday June 28 2006, @11:51AM (#15622058) Homepage
      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.

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

  • I'd prefer to see a toolkit that provides unobtrusive JavaScript [adactio.com]. Basically, you'd tag (with a specific class) the HTML elements that you'd want to act as UI widgets. Then include the JavaScript file, and the JavaScript file does all the work. This provides graceful degradation -- if they don't have JavaScript, they just get the original HTML. And it lets you use all your standard HTML tools, so your designers can still handle all the look and feel, without having to deal with anything besides HTML and CSS.
  • by kompiluj (677438) on Wednesday June 28 2006, @01:09PM (#15622761)
    Did you say "Google Web Rootkit"?
    • Huh? (Score:3, 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.
      • 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
    • What do you think when you hear "Code Generator?"

      Thats my biggest beef with the way this kit works. The JSNI interface seems like a pure hack to start with doing things like embedding javascript code in a java file using code like the following:

      private native void applyEffect(Element element, String effectName) /*-{

      // Trigger named Scriptaculous effect
      $wnd.Effect[effectName](element);
      }-*/;

      I find these kinds of toolkits get you up and going quickly, especially if you are new. However, the firs

    • 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.
    • *Kaffe* [kaffe.org]

      There's not a lot of tolerace for criticism of corporations, is there?
      I think that most coders feel the same way.

      • Yes ... Java is an OO language
        No ... Java != OO
        Thus it's ok to have different opinions on them.
          • OO = Object Oriented
            Many computer languages are or can be Object Oriented (Java, C#, VB.NET, C++, etc.)
            Therefore Java is a sub set of Object Oriented Programming
            Object Oriented Programming is not just Java though, cause as said above it could be C++, C#, VB.NET, etc.
            Therefore, I believe it's ok to say then that Java (as a subset of OO) may suck ... but Object Oriented Programming in general does not (cause for example C++ rocks).
            Well, I tried.
              • In school ... my favorite languages were probably in the following order
                • C++ - I learned this first, and it was tricky, but incredibly beneficial to learn
                • Java - Once I already new C++, Java was REAL REAL easy ... and I also just loved how clean and easy it was to program in ... although in larger projects, at least back when I was in school, I did notice significant performance differences as compared to C++
                • C - After learning C++, C was like a fun throwback ... it becomes a very interesting language ..
    • 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 wi
    • When I saw the announcement I was initially excited... then I saw that the first stage was to write a Java Swing application.

      Well, I'm writing a Java Swing application at the moment for non-GWT purposes, and it's a horrible, painful process. I'd rather write raw HTML and JavaScript any day. It's not just a Swing issue; there are still too many things in Java that are way, way more difficult than they ought to be. (Like date and time handling, for instance.)

      I really wonder why they built this thing using Jav
    • Why I like YUI (Score:5, Interesting)

      by HotButteredHampster (614950) <s.biickertNO@SPAMshaw.ca> on Wednesday June 28 2006, @11:03AM (#15621657) Homepage
      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