Slashdot Mirror


GWT in Action

Michael J. Ross writes "Server-side computer languages, such as Java, possess numerous advantages over their client-side counterparts — including more robust integrated development environments (IDEs). In contrast, Web-focused languages, such as JavaScript, benefit from the global accessibility of the Internet. Bridging this gap, and leveraging the strengths of both sides, has long been an objective of the software development community — though not all attempts have been successful, e.g., Java applets. The Google Web Toolkit (GWT) is the latest attempt, and shows considerable promise, as illustrated in a new book intended to help programmers learn this new technology: GWT in Action." Read on for the rest of Michael's review GWT in Action author Robert Hanson and Adam Tacy pages 600 publisher Manning Publications rating 6 reviewer Michael J. Ross ISBN 1933988231 summary A practical introduction to programming with the Google Web Toolkit (GWT). Written by Robert Hanson and Adam Tacy, this book was published by Manning Publications on 5 June 2007, under the ISBNs 1933988231 and 978-1933988238. For any prospective reader who would like to learn more about the book, they can first try the book's Web page, where they will find online versions of the "about this book" section, table of contents, preface, and index. The publisher offers two freely downloadable chapters, "Creating the Default Application" and "Communicating with GWT-RPC," in PDF format. In addition, there is a link to purchase the book's electronic version, and a link to the author's forum, where readers can post questions about the book or GWT, and likely receive a response — perhaps even by one of the authors.

The book's 17 chapters are organized into four parts, and cover a generous number of topics: introduction to GWT; creating the default GWT application; building your own application based upon the default one; creating widgets and panels, including composite panels; processing user events; creating JSNI components; modularizing your code; communicating using GWT-RPC; client-side RPC; classic Ajax and HTML forms; using JSON for interoperability; automatically generating code; GWT's native properties; testing and deploying GWT applications; more on the inner workings of GWT itself. The book has no appendices, but a substantial index, which is essential for such a technically detailed subject area.

GWT in Action is clearly intended to be a practical and fairly comprehensive coverage of Google's new toolkit. Almost all of the GWT concepts are explained within the context of developing a substantial sample application, the Dashboard, created by the authors. The reader is encouraged to follow along as the authors build the application, thereby learning from doing — almost always an effective approach. At 600 pages, with almost none of the formatting padding found in far too many technical books nowadays, the authors have not skimped on providing the reader with a lot of information. Furthermore, their treatment of application deployment is far better than any other I have encountered.

Unfortunately, the book has many weaknesses. On an overall basis, the order of presentation is at times disjointed — seemingly dictated more by the Dashboard and less by the most logical order for someone new to GWT. Compounding the problem, the authors frequently refer to advanced topics, covered in greater detail later, and also repeat earlier information, occasionally several times. Despite promises to provide a gentle exposition, it can be difficult at times for the reader to determine if any critical steps were skipped, as a consequence of key instructions for building the sample application being spread out, and interspersed with too many references to general comments covered earlier. In turn, readers will likely find it frustrating to try to get the sample application working at each step of the development process — and not just at the end, with the complete code.

One source of these difficulties, is that in the first few chapters, the authors try to introduce too many topics all at once, and as a result do not thoroughly discuss each one in its own section. Instead, they break up the information over multiple sections, scattered throughout the book. An example of this is internationalization. Section 2.2.4 is titled "Implementing Internationalization," and yet provides almost no details, and is essentially unusable by itself. At the very least, it should mention that later sections 3.2.1 and 15.3 provide a lot more information. Furthermore, internationalization was introduced far too early in the book, and greatly complicates the process. Instead, the authors should have created a simple application using only English for the user interface, and introduce internationalization later, after fully explaining the basics of turning Java code into JavaScript functionality.

Part I of the book is the weakest of all of them, which may, sadly, turn off readers who would otherwise get to the better material later. The authors are clearly enthusiastic about the topics at hand, and the number of moving parts associated with Java/JavaScript/GWT development is certainly not trivial. Nonetheless, those initial chapters would greatly benefit from a rewrite; this would make the material more comprehensible and easier to follow, step-by-step.

We can mention some specific flaws: A book like this that is introducing a new technology, must take care to not leave the unwarned reader wondering if they have been left behind in the steps. People reading some of the earlier material may conclude that those steps have already been assumed by the authors, and will not be covered. The authors do not mention how to obtain and install GWT until page 30; that should be right up front. The authors do not appear to mention which version of GWT they used for the book. (I chose 1.3, not 1.4RC, available as of this writing). Any reader trying to follow along and implement their example application (the Dashboard) will probably find several hurdles. First of all, make sure that you have version 1.4 of GWT installed, and not 1.3.3, which does not include some of the panels and widgets used in their sample code.

In Chapter 1, they modify a "Hello world" application to create another application that shows a tic-tac-toe board that has clickable squares, but does not play the game. Chapter 2 describes this as "a fully functioning Tic-Tac-Toe application," which is like claiming a program works because it compiles. Also in Chapter 2, their discussion of development alternatives is slowed down by repetition of the same information. The sample code in the book has minor inconsistencies. For example, naming a password String "oldPass" in one method, then "old" in another, related method. There are other instances, but these give one an idea of some of the inconsistencies.

The coverage of topics is generally quite thorough, though at times verbose and redundant — particularly in Chapter 2, though it is certainly not limited to that chapter. The second and third paragraphs in Chapter 3, for instance, continue the repetitious style which is found in many places throughout the book, and likely has made it longer than necessary. In Chapter 4, the first two pages explain what widgets are, several times, and conclude with a picture of a button — as if any reader who has made it that far into the book doesn't know what a button is. The book could certainly use some trimming.

The downloadable source code is not complete. For starters, it is missing the code from Chapters 1 and 2, though admittedly none of that is too long. The code provided for Chapter 4 is just a portion of what is displayed in the book. Moreover, the directory paths in the sample code archive files, are not consistently named, and some may even be incorrect. For example, the code for Chapter 5 has a folder named "Dashboard — Chapter 4." That sort of thing does not instill confidence in the typical reader. The authors should revisit the sample code — making it complete and consistently named.

The publisher's page for the book does not appear to have a link for errata; perhaps none have been reported yet. Here are some: On page 75, in Table 3.1, in the left-hand column, "gwt-onLoadErrorFn" should instead read ""gwt:onLoadErrorFn." On page 77, in the second paragraph, the file name extension should be all lowercase, not all uppercase. On page 78, in Listing 3.6, the String parameter in the first label.setText() call should be delimited with straight quotes, not curly quotes. (Microsoft Word strikes again?!) On page 81, in the third paragraph, "comply to" should read "comply with." On pages 87 and 88, the -whitelist and -blacklist option values each contain an extraneous space before the "^." There are undoubtedly more such errata throughout the book, and can be corrected in the next edition; but these are enough to at least get an errata file started. Fortunately, none of them would lead an alert reader astray.

Even though the book could use significant reorganization and streamlining in the next edition, GWT in Action is packed with practical information on a wide range of GWT topics.

Michael J. Ross is a Web developer, freelance writer, and the editor of PristinePlanet.com's free newsletter.

You can purchase GWT in Action from amazon.com. Slashdot welcomes readers' book reviews -- to see your own review here, read the book review guidelines, then visit the submission page.

34 of 216 comments (clear)

  1. The more I learn about JavaScript... by SanityInAnarchy · · Score: 4, Insightful

    The more I learn about JavaScript, the more I like it as a language.

    I'm not really sure I see the point of GWT, given that JavaScript is actually a more powerful language at this point. I'm almost tempted to suggest that someone build a webserver platform around a JavaScript interpreter.

    Well, almost. The problem with JavaScript is that it's horribly slow to execute. But then, you still have that problem, even if it's JavaScript generated from Java code.

    --
    Don't thank God, thank a doctor!
    1. Re:The more I learn about JavaScript... by jmyers · · Score: 2, Funny

      "I'm almost tempted to suggest that someone build a webserver platform around a JavaScript interpreter."

      duh... IIS and asp
      @ Language=JavaScript

    2. Re:The more I learn about JavaScript... by AKAImBatman · · Score: 2, Interesting

      The problem with JavaScript is that it's horribly slow to execute.

      Depends on your engine. I've put some thought into the same sort of server-side Javascript engine as you have. Someone else mentioned the Netscape Enterprise Server. That was... not so great. I was thinking more along the lines of building on top of a Java Servlet Engine. The Mozilla Rhino Javascript Engine actually compiles the JS down to Java byte code. That wouldn't be all that special, except that the JVM then JITs that to native code. Which means that Javascript doesn't have to be slow. ;)

      I figure you could create a JSHttpServlet object and map a file of your own extension (it can be *.js if you want it to be) to that servlet. The servlet then creates a JS environment that maps HttpRequest and HttpResponse as global variables. You can even map HttpSession and a PrintWriter output stream if you want. (That gets pretty close to JSP territory. ;-)) Load the script at init() time, and execute it when called.
    3. Re:The more I learn about JavaScript... by fireboy1919 · · Score: 2, Interesting

      But then, you still have that problem, even if it's JavaScript generated from Java code. That's not really what's going on.

      GUI stuff happens in Javascript. Anything really complicated gets sent over to Java. That's why it's called an AJAX framework, not a Javascript framework.

      I like Javascript, but it has the same problem as PHP: no namespaces. Using it as a real language would causes the same problems you see there: security issues, hard-to-read code, difficulty refactoring, interoperability problems, etc. You can actually see those problems and the various mechanisms to overcome them in a lot of the modern pure-javascript libraries (prototype especially is known for breaking existing javascript libraries, for example).
      --
      Mod me down and I will become more powerful than you can possibly imagine!
    4. Re:The more I learn about JavaScript... by Gospodin · · Score: 2, Informative

      Not. Java doesn't have closures. Java functions aren't first-class objects.

      JavaScript, OTOH, isn't typed.

      There's loads of differences between them. All I'd want from JavaScript is more performance, namespaces, and possibly some very basic native OO concepts so that I can define an inherited class without three or four declarations and maybe have private and static members.

      --
      ...following the principles of Heisenburger's Uncertain Cat...
    5. Re:The more I learn about JavaScript... by ispeters · · Score: 2, Informative

      The more I learn about JavaScript, the more I like it as a language.

      I'm not really sure I see the point of GWT, given that JavaScript is actually a more powerful language at this point.

      I agree with you that Javascript is a nicer language than Java and more powerful to boot, but I'm using GWT for one big reason: dead code elimination. The GWT compiler takes advantage of the static analysis possibilities in Java and the closed-world nature of a web page and produces dramatically optimized Javascript. The resulting code is obfuscated, which reduces download time, and has all the dead code eliminated, which reduces download time. Also, for broken interpreters, like the one in IE, a smaller script executes faster, on top of downloading more quickly.

      I guess what I'm saying is that GWT brings a compiler to Javascript and that has many benefits. For the GWT compiler, Java is to Javascript as C is to assembler in a C compiler. Generally speaking a C compiler produces better machine code than someone writing assembler by hand. The same is true for the GWT compiler--its output runs faster than a comparable programme hand-written in Javascript.

      Ian

    6. Re:The more I learn about JavaScript... by fredrik70 · · Score: 2, Insightful

      javascript is a prototype based language, rather than class based (although you can simulate it quite nicely).
      more info here

      --
      if (!signature) { throw std::runtime_error("No sig!"); }
  2. Re:Wow by Drew+McKinney · · Score: 5, Funny

    That's a lot of reading. Can someone sum it up in 5 words or less for us lazy people? Thanks in advance. Comprehensive. Disjointed. Overwhelming. Broken code.
  3. Re:Wow by cromar · · Score: 3, Interesting

    He seems to be saying that overall it's a good book :D

    Is it just me or is anyone else glad to see a review on Slashdot without a chapter by chapter summary? One of the most pointless, pedantic mistakes in book reviews is to summarize each chapter. Hoozah for the writer!

  4. Re:Wow by hansamurai · · Score: 3, Funny

    From actually having tried out GWT, here's my five (and a half) words of advice:

    Don't Use Google Web Toolkit.

  5. Worse than Wicket? by kisrael · · Score: 3, Interesting

    Yeah?

    I did an evaluation of it. I kind of liked it, but in general don't like "lets make a servlet environment pretend its an applet", so I didn't endorse.

    Now, after months of using Wicket, I wish I had pimped for it more. Seriously. If you're gonna pretend it's an applet, then REALLY do it like GWT does, fake JVM and all. This Wicket stuff.... ugh. keeping the html view and java in synch for anythign complex is SO IRRITATING.

    Seriously, after years of Struts and stuff like Wicket, I don't see any real advantage over "Model 2+" (Servlet/JSP pairs) that I started with in 2001. There is a benefit to simplicity and writing HTML in HTML and writing Javascript in Javascript that over-engineers who are, frankly, a little OO-obsessed just don't get.

    Maybe years of Perl CGI has bent my brain but The HTTP Request/Response paradigm just doesn't seem so awful that it needs to be (leaky) abstracted away.

    --
    SO YOU'RE GOING TO DIE: The Comic for Dealing with Death
    1. Re:Worse than Wicket? by kisrael · · Score: 3, Insightful

      I just don't see what Wicket - or possibly any web framework - buys you.

      Maybe especially core Wicket, which isn't trying to do much but wrap HTML bits as objects. What really is the benefit of that? Nothing seems simpler and it often seems to be getting in the way-- maybe it's a mental gap problem, but often I end up having to put placeholder HTML in the page, and the set visibility = null. And the Ajax support is so-so.

      I mean, I think the fact that the static Wicket homepages often produce session timeout exceptions is pretty damning that it encourages poor web programming.

      --
      SO YOU'RE GOING TO DIE: The Comic for Dealing with Death
    2. Re:Worse than Wicket? by eddy+the+lip · · Score: 4, Insightful

      There is a benefit to simplicity and writing HTML in HTML and writing Javascript in Javascript that over-engineers who are, frankly, a little OO-obsessed just don't get.

      I couldn't agree more. I like my code structured, clean and simple, and layering abstraction upon abstraction is not a good way to achieve that. I'm also a big proponent of writing to the language's strengths. JavaScript has some annoying weaknesses (lack of namespaces), but things like it's object prototyping are very powerful, and it seems silly to give that up. For all the browser inconsistencies, HTML + CSS is actually quite a nice layout tool. Getting them all to work together requires some organizational skills, but it pays off in ease of use and a higher level of control.

      These are tools a web developer really should be comfortable with anyway, so while I can see the utility of something like GWT if you're not, to really excel at it, you should be knowledgeable about them.

      --

      This is the voice of World Control. I bring you Peace.

    3. Re:Worse than Wicket? by kisrael · · Score: 2, Interesting

      Yeah.

      Sometimes I worry that I come up with my philosophy about languages to suit my personal gripes and history, and that ultimately that limits me as a developer, but...

      Anytime you borrow someone else's toolkit that adds some kind of organization/abstraction over an existing technology... well, either you're losing bits of the functionality of the lower level, or what you're learning is about as complex as the lower level.

      My strong personal preference is to write your OWN, app-specific organization.

      The counter argument comes from people who are heavily OO in their outlook. (more specifically, I think a gap tends emerge between people who cut their teeth on simple CGI-wrapping things, and got used to using a HashMap mentality for most client/server interaction, and people who cut their teeth on apps and applets, for whom the gap between Java code and what's physically displayed onscreen seems weird and in need of being abstracted away.) Anyway, these folks say that, look, the organization I want is OO, writing this kind of Object->screen element->response mapping ls a repetitive task, so I'm willing to buy into someone else's approach to do that work. That's where something like Wicket comes in.

      My recent semi-revelation for this kind of tool-kit was this: "text" is amazing. It has been the lifeblood of programming for decades, ever since we could get away from punched cards I guess, despite attempts at cutesy visual languages. It's just so powerful, concise, easy to manipulate, easy to automate that manipulation, and in its own way visual (hence the wars over the one true brace style etc) that it will be around for a long long time. But text is, by the way we use it, rather procedural, and while you can do OO in it, that's a new level. But sacrificing the ability to adjust HTML and CSS and Javascript in TEXT on the alter of Objects just seems like too big of a sacrifice to me.

      Of course, taking an anti-OO stance is a heresy (see http://geocities.com/tablizer/oopbad.htm ) and you have to be careful so you don't seem like a crazy nut job who hasn't worked on large scale projects. But my latest take on it is this: "People and Programs are both best defined by what they DO, not what they ARE".

      Another way of looking at it: in Java, when stuff goes wrong, what's your stack trace like? There's always that boilerplate JVM/Server engine at the bottom, but if the core of what's at the top ain't your code, your debugging is going to be a lot harder, because your mistake is in how you set up the other guy's objects to do the work, not you doing the work yourself. (Assuming the other guy's stuff is solid.)

      --
      SO YOU'RE GOING TO DIE: The Comic for Dealing with Death
    4. Re:Worse than Wicket? by poot_rootbeer · · Score: 2, Insightful

      I'm also a big proponent of writing to the language's strengths.

      You can't really write a web application using a (single) language, though; you need to have some degree of expertise in HTML and CSS AND Javascript AND whatever language(s) your server-side code is written in...

      I can see some appeal in toolkits that unify everything into just one language, for the developer's convenience. It's still pretty much impossible that the output of such a toolkit will be anywhere near as elegant or efficient as natively developed code in each area.

    5. Re:Worse than Wicket? by joshv · · Score: 3, Insightful

      Sure, using other people's code makes it harder to debug. And some things are just plain out of your control. Over the course of my career I've spent man-months troubleshooting and configuring 3rd party frameworks. I don't care, because I would have spent man-years writing them myself.

    6. Re:Worse than Wicket? by nuzak · · Score: 2, Interesting

      Wicket's an example of a minimalist concept that refused to grow beyond it in order to satisfy some ideology of "purity". Refusing to support even a moral equivalent of taglibs is an example. Tapestry has always struck me as far more pragmatic, and Tapestry5 looks downright amazing. Seam with Facelets strikes me as an awesome solution, though you're dealing with an insanely complex stack (JSF) under the surface, and wherever JSF is inadequate and Seam doesn't cover for it, you're forced into workarounds that may have you ditching Java for your project altogether.

      I'm an example of the last case -- a java burnout. We never needed scalability (internal apps with maybe 50 total users), so I'm back to cobbling together perl and python and even php now. Ironically, the need to glue these apps together has led to adopting more enterprisey stuff like SOAP and ESB's, but in a very ala-carte way. Useful enterprise apps remain grown, not engineered.

      --
      Done with slashdot, done with nerds, getting a life.
    7. Re:Worse than Wicket? by chillenious · · Score: 2, Informative

      Seriously, after years of Struts and stuff like Wicket, I don't see any real advantage over "Model 2+" (Servlet/JSP pairs) that I started with in 2001. There is a benefit to simplicity and writing HTML in HTML and writing Javascript in Javascript that over-engineers who are, frankly, a little OO-obsessed just don't get.

      Sorry to hear it doesn't work for you. A little OO-obsessed though? Because the framework takes a stance to actually try to provide a real OO programming model where other frameworks simply don't?

      I agree that there is a lot to say for simplicity. Especially if your problem is simple. However, my experience is that model 2 just doesn't cut it. I shudder to think back to the horrible instances I've seen of code duplication you get when you can't properly reuse widgets and the tons of hacks I've seen to get around the statelessness of web applications. And then scripting in templates, making them hard to sync with changed designs/ hire a designer to work on them and simply hard to track where logic is put in the first place. I don't know about you, but I never had much fun refactoring JSP and Velocity templates.

      Wicket focusses on OO as that facilitates reuse and lets you better cope with complexity. Wicket enforces clean templates so that you won't get yourself into maintenance hell. But it may or may not work for you. It does for me and many others, but so many people, so many tastes. In the end it is a trade off that can be annoying in the short term, but should save you trouble in the long run.

      Maybe years of Perl CGI has bent my brain but The HTTP Request/Response paradigm just doesn't seem so awful that it needs to be (leaky) abstracted away.

      If what you are trying to do fits the request/ response paradigm, that's fine. I for one, prefer to reason about screens that have panels, forms, fields, tabs and buttons on them, and I don't want to rewrite half of my pages just because I decide to put a wizard in a tab, or move a pageable list to another page or whatever.

      If you can use Ajax all the way, a simpler approach like using HTML + JS and maybe DWR should work fine, though a library like GWT should help you avoid all those nasty browser issues etc, AND let you write strongly typed (maintainable) code.

    8. Re:Worse than Wicket? by chillenious · · Score: 3, Informative

      I just don't see what Wicket - or possibly any web framework - buys you. Maybe especially core Wicket, which isn't trying to do much but wrap HTML bits as objects. What really is the benefit of that?
      You're obviously missing the point indeed. What it aims to do besides providing abstractions is facilitate a stateless programming model that is safe by default and doesn't leak implementation details of widgets all over the place.

      but often I end up having to put placeholder HTML in the page, and the set visibility = null.
      use <wicket:enclosure> an you don't have to use extra placeholders.

      And the Ajax support is so-so.
      What's wrong with it? It's entirely optional.

      I mean, I think the fact that the static Wicket homepages often produce session timeout exceptions is pretty damning that it encourages poor web programming.
      If pages are not session-relative, design them to be bookmarkable. All you need to do is put a default constructor or a page parameters constructor in them. With Wicket, you'll have to do a bit of planning for bookmark-ability. But why is that bad? It is secure by default. In contrast with most application frameworks and the REST approach that let you leak internal things like PK's etc by default, so that you'll have to secure your site as a separate effort. Creating a site in the model 2 two way with Wicket, completely stateless, isn't very hard either. Just make pages for every function (like you'd do with actions for model 2 frameworks) and use page parameters to pass your 'state' around.
    9. Re:Worse than Wicket? by chillenious · · Score: 2, Insightful

      just that one book and some very basic tutorials.
      And now Wicket In Action is available (partly) via early access. But agreed documentation could be better, which holds true for most open source projects that depend on unpaid volunteers.

      I haven't seen leaky PKs be too much of an issue. A lot of keys are just local identifiers, or your API should be doing requisite security checks.
      But it is something you'll always have to be aware about. The application I'm working for for instance, has a very fine grained authorization model. Now, I never have to worry about users accessing the wrong data just by guessing URLs etc; all that information is server-side only. And I know from experience that that would have been quite a different story when using e.g. a model 2 framework.
  6. I Still don't know what GWT is by chad_r · · Score: 4, Informative
    The review had everything except a brief summary of what GWT actually is. I had never heard of it until now. From http://code.google.com/webtoolkit/overview.html:

    What is Google Web Toolkit?

    Google Web Toolkit (GWT) is an open source Java development framework that lets you escape the matrix of technologies that make writing AJAX applications so difficult and error prone. With GWT, you can develop and debug AJAX applications in the Java language using the Java development tools of your choice. When you deploy your application to production, the GWT compiler translates your Java application to browser-compliant JavaScript and HTML.

    Here's the GWT development cycle:

    1. Use your favorite Java IDE to write and debug an application in the Java language, using as many (or as few) GWT libraries as you find useful.
    2. Use GWT's Java-to-JavaScript compiler to distill your application into a set of JavaScript and HTML files that you can serve with any web server.
    3. Confirm that your application works in each browser that you want to support, which usually takes no additional work.
  7. Beyond hope by k-zed · · Score: 5, Insightful

    The sentence "Server-side computer languages, such as Java, possess numerous advantages over their client-side counterparts - including more robust integrated development environments (IDEs)." is possibly the most retarded thing I have ever seen on Slashdot. Ever.

    Come on, doesn't anybody read these?

    --
    we discovered a new way to think.
    1. Re:Beyond hope by Bluesman · · Score: 4, Funny

      Yeah, it's one of the dumbest things on the front page *today*, but ever? Let's not get carried away.

      --
      If moderation could change anything, it would be illegal.
  8. GWT *and* Java by owlstead · · Score: 4, Informative

    I would like to point out that the GWT can also be used from a Java server application. I'm using a package from Instantiations, WindowBuilder Pro, that can generate Swing (default Java GUI), SWT (IBM/Eclipse GUI) as well as the Google Window Toolkit. It's an application/plugin for creating graphical interfaces, so you would probably not get too exposed to the GWT itself. I haven't yet tried it out, but it might be a good idea to start of with a GUI builder and only delve deeper when needed. Of course, understanding what happens is great when you need to debug something, or if you are not happy with the functionality. But I would not start off by writing web-pages when trying out this relatively new technology.

    Before somebody grills me, the version of WindowBuilder Pro that I am using is a bit unstable and crashes Eclipse now and then. Lots of memory is also recommended (then again, if you are a developer, you need lots of memory anyway).

    1. Re:GWT *and* Java by owlstead · · Score: 2, Informative

      I *knew* I was too tired to write this reply. Google Web Toolkit it is. Are there any slashdottees that would like to proofread my replies?

      Nah, didn't think so :)

  9. Re:Wow by doofusclam · · Score: 3, Informative

    Well, i've avoided writing web stuff for my whole career but when I got lumbered with a project at work I used GWT.

    Firstly, I had loads of problems. However they were mainly down to broken stuff in the RC builds (all fixed now that it's out of beta) and the fact that I was learning Java as I went along. Nothing that was a major problem was down to the architecture of GWT.

    If i'd have written pure javascript instead then doubtless it'd have taken far longer and worked less well.

    GWT rocks for anything where you need to write anything with a rich web gui and a large amount of interaction between this and a backend. I can use Eclipse to single step through my Java code, with breakpoints and all that stuff. GWT also takes all the browser specific hassles away, for example with the differing rich text area implementations used by all the browsers. Without these niceties i'd have given up on web development before i'd even started.

    Oh and the google group for GWT is great - i've had problems answered within ten minutes. The Google team are very visible and are obviously proud of their product. Rightly so, too.

  10. Why should GWT be on my radar screen? by scottsk · · Score: 2, Insightful

    Does the book - or somewhere else - address why GWT ought to be on my tla radar screen? Does it work with Apache, or just J2EE containers? Is it open source? I know I could find that out by, um, googling the information, but if the book is meant to evangelize the tla, I would have expected it to concentrate more on why I should use GWT and in which situations, not how to build a tic-tac-toe game.

  11. I want to write desktop apps with JS/GWT/whatever by joe_n_bloe · · Score: 2, Interesting

    Some day, I'll be able to use a browser to write desktop apps without resorting to plugins or XUL or whatever. No, Google Gears doesn't do that.

    JS is a great language and GWT is a great tool, especially the hosted development environment. But it will never reach its potential until it is a general purpose application programming language.

  12. Re:Wow by Angostura · · Score: 2, Interesting
    Here's what happens when I take the review and run it through Microsoft Word's 'Autosummarize' Tool, set to the most violent setting: "100 words or less":

    The publisher offers two freely downloadable chapters, "Creating the Default Application" and "Communicating with GWT-RPC," in PDF format. Unfortunately, the book has many weaknesses. The authors do not appear to mention which version of GWT they used for the book. The sample code in the book has minor inconsistencies. For example, the code for Chapter 5 has a folder named "Dashboard -- Chapter 4."
    ... yup, that seems to cover most of it.
  13. Very nice toolkit with some problems by plams · · Score: 3, Informative

    The content on Google's GWT site almost speaks for itself concerning the power of it, so I'll elaborate on some negative aspects I've encountered.

    I went to explore the possibility of a non-servlet based backend and very quickly encountered problems that are not really GWT's fault but a side effect of having a hosted environment: the browser is based on Mozilla and thus inherits the security restrictions of it. I could not make RPC calls to my backend web server because Mozilla disallows cross-domain access. I spent a lot of time trying to circumvent this, and did find some work-arounds but nothing that worked to my satisfaction (too cumbersome). GWT should offer a modified Mozilla with these restrictions removed, or even better, adopting Flash's excellent practise of looking for a crossdomain.xml file in the root of the target webserver (to see whether access is allowed or not).

    Also, developing on an AMD64 based Linux I discovered that the hosting environment just doesn't work running from a 64bit JVM. Setting up a 32bit JVM isn't that difficult, but it's not a good solution (However, I talked to a GWT developer on IRC who claimed this issue was high on their priority list).

    Lastly, GWT is a nice environment, but it's still a bit young. It seems stable enough, but if you engage in a large GWT based project you may find yourself doing a lot of low-level client-side code unless their limited palette of widgets and other client-side features completely cover your needs

  14. Shameless plug - chess board diagram composer by SashaM · · Score: 3, Interesting

    Just a few hours ago I finished a small, mostly-for-fun project in GWT, and now I see a GWT-related story on slashdot. Surely it's not a coincidence and therefore I must pimp my project: a chess board diagram composer.

  15. Re:It's so simple, but... by Eponymous+Bastard · · Score: 3, Informative

    I looked into GWT a month or two ago. From what I understood, you can write both client and server code in Java and then GWT compiles the client to Javascript and the server to a servlet.

    You don't actually write any SOAP code, but rather use Java Remoting to call across the wire, getting a Java object back that you can manipulate. The GWT compiler translates that into a XML request and writes all the serialization/deserialization code and so on. In fact it doesn't seem to be able to call an XML web service at all (that's the reason why we didn't pick it up for our UI, our company does business logic in C#).

    Since it is also a widget library you should be able to have complex widgets with multiple DOM elements and access them as a unit. You could write your own javascripts objects to access the DOM, but then it's basically a GUI library.

    As far as I can tell, the whole point is to write both client and server with a single language and interface, which is very useful.

    For example, in our case, the pages are generated with ASP.Net in C#. If we want to disable a button when the page is served we do buttonSubmit.Enabled=false; but if we want to reenable it without a postback, we have to add javascript code to find the DOM node for the button and then enable it. Imagine how messy it gets when you want to add a row to a datagrid. After a while you can't tell all the interactions in the GUI handling logic. I'd love to have something that allows me to write an event handler where I can just write "buttonSubmit.Enabled=true;" and let the compiler work out all the DOM walking code.

    So you have three choices:
    - Serve the full page (formatted in server side language) and then tweak it in javascript, relying on knowledge of the widget library's rendering.
    - Serve a bare bones page and do all the GUI in Javascript, both initial and updates. Let the server handle business logic only. I see some posters have suggested moving the initial javascript rendering to the server.
    - Serve a full page and let something like GWT convert the client side code from working with the same objects as the server to a working Javascript/DOM implementation. This is the approach GWT is taking.

    Of course, I only looked at it for a couple hours, so someone will probably tell me all the ways I'm wrong.

  16. GWT in Python and Ruby by egghat · · Score: 2, Informative

    My major gripe about GWT ist the use of Java, which I never liked.

    So I want to give oyou two pointers to projects that could need help to transfer the idea of GWT from Java to Python and Ruby:

    Python: pyjamas - build AJAX apps in Python (like Google did for Java).

    Ruby: Blog Entry from Michael Neumann, who tries to port GWT to Ruby.

    The Ruby stuff is in the very early stages ...

    Bye egghat.

    --
    -- "As a human being I claim the right to be widely inconsistent", John Peel
  17. Point of existence by JochenBedersdorfer · · Score: 2, Interesting

    One of the most important points for using something like GWT has been missed: You can write test code for GWT very easily! If you ever tried to debug a mid-sized Javascript application, you know what I'm talking about. With GWT you have a hosted environment that makes debugging much easier. Also, you can employ Test Driven Development much easier. There is even explicit support for JUnit in GWT. For your favourite toy web application, GWT may be overpowered. For massive, distributed internet applications who need to involve the client side as much as they can, GWT currently is the best solution for Java shops.