{"id":89,"date":"2006-05-18T09:42:41","date_gmt":"2006-05-17T23:42:41","guid":{"rendered":"http:\/\/www.thunderguy.com\/semicolon\/2006\/05\/18\/google-web-toolkit\/"},"modified":"2009-12-05T16:46:17","modified_gmt":"2009-12-05T03:46:17","slug":"google-web-toolkit","status":"publish","type":"post","link":"https:\/\/thunderguy.com\/semicolon\/2006\/05\/18\/google-web-toolkit\/","title":{"rendered":"Google Web Toolkit"},"content":{"rendered":"<p>Google have released the <a href=\"http:\/\/code.google.com\/webtoolkit\/\">Google Web Toolkit<\/a> &#8212; &#8220;Build AJAX apps in the Java language&#8221;. At first I thought this might just be their version of the <a href=\"http:\/\/developer.yahoo.com\/yui\/\">Yahoo UI Library<\/a>, but it turns out to be a completely different approach to the same problem. The YUI Library (and most other <a href=\"http:\/\/www.thunderguy.com\/semicolon\/2006\/05\/16\/ajax-how-to-do-it\/\">Ajax libraries<\/a>) allow you to build a Web UI directly, using HTML and JavaScript. With GWT, you write a GUI application in Java, and GWT translates it into JavaScript and HTML for web deployment. It&#8217;s a less flexible approach, but could make it easier for Java developers to develop web applications with desktop-style GUIs &#8212; if this is what they really want.<\/p>\n<p>I distinguish three different styles of application user interface:<\/p>\n<ul>\n<li><strong>Desktop<\/strong>: Rich UI widgets, very responsive, minimal dynamic effects. For example, Microsoft Word or any traditional desktop application.<\/li>\n<li><strong>Web 1.0<\/strong>:  The traditional web site. Basic UI widgets only, slow response (with frequent full-screen refreshes), no dynamic effects. For example, this website. \ud83d\ude42<\/li>\n<li><strong>Web 2.0<\/strong>:  Ajax style. Rich UI widgets, very responsive, dynamic effects such as fades and slides. For example, Google Maps.<\/li>\n<\/ul>\n<p>Not all Web 2.0-style UIs are on the Web, and not all Desktop-style UIs are on the desktop. <a href=\"http:\/\/picasa.google.com\/\">Picasa 2<\/a>, the photo management application, is a good example. It&#8217;s a Windows desktop application, but it definitely has a Web 2.0 interface with a lot of movement and use of colour and fades. Such an interface may not always be appropriate, but the visual approach works beautifully (literally!) in this case.<\/p>\n<p>Now, most Ajax libraries or frameworks allow you to develop web applications with Web 2.0 interfaces. GWT, on the other hand, seems to enable building web applications with desktop-style UIs. It&#8217;s an interesting approach that might make it easier to concentrate more on functionality and less on snazzy visual candy. So you get layout widgets, trees, menus, frames; but no yellow fades, sliding panels or other dynamic effects. However, sometimes the &#8220;candy&#8221; is appropriate, and there&#8217;s no easy way to incorporate other JavaScript libraries. (Some brave soul might like to try using GWT&#8217;s JavaScript Native Interface; you could probably write a Java wrapper for some JavaScript Ajax library. Good luck to you.)<\/p>\n<p>For many, the heart of Ajax is asynchronous server communications. GWT includes RPC functionality, but it&#8217;s pretty bare. For example, GWT and <a href=\"http:\/\/script.aculo.us\/\">Scriptaculous<\/a> both allow you to fetch data from a server; Scriptaculous will automatically populate a div with the data, but the GWT code sample simply has a comment saying &#8220;do some UI stuff to show success&#8221;. You&#8217;re on your own; it really is like building a desktop GUI application. And of course, since you write in Java, you have to declare a serializable Java class for each type of message you need to exchange with the server. Ruby on Rails it ain&#8217;t.<\/p>\n<p>(In a similar vein, I discovered <a href=\"http:\/\/chess.labs.morfik.com\/\">Morfik Chess<\/a> the other day. This is a nice chess UI and chess-playing computer implemented in JavaScript. An impressive achievement, made even more noteworthy by the fact that it is apparently written in Object Pascal and compiled into JavaScript. The last time I used Object Pascal was in 1990; I&#8217;m glad to see it&#8217;s still around.)<\/p>\n<p>If you&#8217;ve already used other Ajax libraries or frameworks, you might wonder why anybody would want to use an opaque, inflexible toolkit like GWT to develop web apps. But if you&#8217;re a Java programmer who feels a bit daunted by multi-browser support, DOM and JavaScript, GWT could make it easy to put your application on the web.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Google have released the Google Web Toolkit &#8212; &#8220;Build AJAX apps in the Java language&#8221;. At first I thought this might just be their version of the Yahoo UI Library, but it turns out to be a completely different approach to the same problem. The YUI Library (and most other Ajax libraries) allow you to [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[38,4,21,18],"class_list":["post-89","post","type-post","status-publish","format-standard","hentry","category-general","tag-ajax","tag-java","tag-javascript","tag-web-development"],"_links":{"self":[{"href":"https:\/\/thunderguy.com\/semicolon\/wp-json\/wp\/v2\/posts\/89","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/thunderguy.com\/semicolon\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/thunderguy.com\/semicolon\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/thunderguy.com\/semicolon\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/thunderguy.com\/semicolon\/wp-json\/wp\/v2\/comments?post=89"}],"version-history":[{"count":1,"href":"https:\/\/thunderguy.com\/semicolon\/wp-json\/wp\/v2\/posts\/89\/revisions"}],"predecessor-version":[{"id":282,"href":"https:\/\/thunderguy.com\/semicolon\/wp-json\/wp\/v2\/posts\/89\/revisions\/282"}],"wp:attachment":[{"href":"https:\/\/thunderguy.com\/semicolon\/wp-json\/wp\/v2\/media?parent=89"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/thunderguy.com\/semicolon\/wp-json\/wp\/v2\/categories?post=89"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/thunderguy.com\/semicolon\/wp-json\/wp\/v2\/tags?post=89"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}