************************************* * * * DB/C Newsletter * * June 2006 * * * ************************************* News and Comments Google is an amazing company, even ignoring its financial success. Inventing the concept of mining the web for content and then attaching advertisements to that free content was brilliant. Google is now trying to follow up its smash hit with more technical advances. I use Google News every day to find out what's going on in the world. Google Maps and Google Earth are also my favorites for satellite imagery. Many use Google Mail and Calendar, and now the company has introduced web-based word processing and spreadsheets. Last month, Google released the first beta test version of a most interesting tool for developing web-based applications. It is called the Google Web Toolkit and it is the subject of this month's article. don.wills@dbcsoftware.com ****************************************************************************** The Google Web Toolkit Here is a description of the Google Web Toolkit from the Google Web Toolkit Product Overview web page - "Google Web Toolkit (GWT) is a 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." And here's the web site for the Google Web Toolkit - http://code.google.com/webtoolkit/ Many business application development groups are now building browser- based web applications. There are several reasons for this. One is ease of implementation on the desktop (typically zero effort). Another is that web apps provide Internet access to applications so that customers, vendors and others can gain access to applications without having to talk to a human being, or be connected to an internal network. However, it is not easy to build rich, browser-based web applications. Incompatibility is a big problem between different browsers, even different releases of the same browser (Internet Explorer is notorious for this). Getting good performance is also not easy. One of the biggest hurdles for doing browser-based web app development is that a programmer needs to essentially learn three very different languages - HTML, JavaScript, and a server-side language (which can be almost any language, but is typically Java, PHP, Pearl, C++, or C#). Today's HTML is a huge language with lots of incompatibilities between different browsers. Tools such as DreamWeaver are a necessity for building really nice looking web pages. But coordination between web page designers and programmers is hard, so much so that in cases where the application is very data rich (e.g. it looks more like a normal DB/C application than anything else), the programmer assumes some or all of the responsibility for HTML coding. JavaScript suffers from many of the same browser incompatibility issues that afflict HTML. As a language it looks similar to Java and C#, but it is actually much different. It is weakly typed, and its native API is very different from Java. In addition, one needs to learn the semantics of the Document Object Model (DOM) which is used by JavaScript to dynamically modify web pages. On top of all that, the traditional HTTP request/response method of communicating with the server is very slow and requires a page redraw. To Microsoft's credit, they recognized this was a big problem, so they invented the asynchronous server request/response method that is used between JavaScript on the client, and the server program on the web server. Put all of this together and you've got AJAX. Amazingly, many good AJAX web apps have been deployed. But the cost of development and maintenance is much higher when compared with a typical desktop application. Google recognized these problems, and because they are doing very sophisticated AJAX development for Google Maps, Google Spreadsheet and others, they built GWT which allows a programmer to write only Java code to build AJAX apps. No coding in HTML or JavaScript is required. After spending many hours working with GWT to develop a typical CRUD (create, read, update, delete) file maintenance application, the following observations can be made - . GWT is a revolutionary tool which will become widely adopted . it is still a beta test product . even though it is in beta test mode, it is stable enough to develop and deploy real applications today . GWT could be the most important thing to keep Java moving forward that has happened since the advent of Eclipse At the technical level, GWT is yet another bunch of APIs that provide essentially two things - a graphical user interface, and a remote procedure call mechanism. The APIs are well designed and simple. The translation of Java to JavaScript has a few limitations that take some time to adjust to. First, JavaScript is single threaded and cannot be blocked waiting for keyboard input or a TCP message. This initially seems to be quite limiting. After getting adjusted though, it actually makes the Java code that will be translated to JavaScript easier to design; no synchronization is necessary because there is only one thread. Another limitation is that reflection (dynamic loading of code unknown at compile time) is not available. A third issue is that the Java base API emulation library (the JavaScript code that does the things in java.lang and java.util) is a little bit sparse - the basics are there, but some more classes need to be added. As GWT matures, this last issue will probably diminish. In summary, GWT is a revolutionary new tool to build browser-based web apps. If you are doing coding in Java now and are building or plan to build web applications, you should definitely give GWT a look. ****************************************************************************** DB/C DX Class Schedule Class: DB/C DX Fundamentals Date: July 11-13, 2006 Location: Woodridge, Illinois For information, send email to admin@dbcsoftware.com. ****************************************************************************** Subscribing to the DB/C Newsletter If you don't already have the DB/C Newsletter delivered to your email address and would like to have it emailed to you monthly, just send an email message to dbcnews-subscribe@dbcsoftware.com. The newsletter will be delivered to the email address from which the message was sent.