SitePoint Tech
TimesMay 24th, 2006 
Issue 139 

Newsletter Archives | Advertising | Contact us  
Tips, Tricks, News and Reviews for Web Coders

In This Issue...

Traditional Gateways aren't the best fit for your VoIP needs

QuintumConnecting a business to a
VoIP network doesn't require a big, expensive integration overhaul. Quintum's VoIP access solutions are designed with "integrated intelligence" so they're the perfect fit for SMEs and branch offices of large enterprises. Our proven solutions fit into existing PBX and IP infrastructures, making them the ideal choice for service providers and network managers.

Intelligent design meets real-world needs of today's businesses - from PSTN-based 911 access to analog fax machine support. And you get non-stop call quality, easy remote management, and lower TCO.

Quintum's intelligent VoIP access solutions are "The Perfect Fit"

Top


Introduction

Kevin YankLike most Java developers, I spent last week watching the proceedings at JavaOne 2006 in San Francisco out of the corner of my eye.

Though there were plenty of exciting headlines and new toys for web developers, the star of the show for me was Google, which launched the Google web Toolkit. In this issue of the Tech times, I'll pull apart this complex, new approach to AJAX to help you decide if it will change the way you build web applications.

Book coverMeanwhile, back at SitePoint HQ we have published yet another new book, but you probably won't want this one on your bookshelf. Instead, Build Your Own Web Site The Right Way Using HTML & CSS is the kind of book you'll want to put on the bookshelves of your family and friends (so they'll stop asking you to build web sites for them!). Written by Web Standards Project Steering Committee member (and generally fun guy) Ian Lloyd, this book teaches the right way to build web sites from the ground up. From semantic markup to CSS page layout, it spells it all out with a healthy dose of good humour.

Lastly, as I promised last issue, I can now announce a couple of conferences at which I'll be presenting later this year:

  • Web Directions 2006
    Sydney, Australia September 26-29 2006

    I'll be presenting a talk entitled "JavaScript APIs & Mashups: work you don’t have to do" with JavaScript Anthology author Cameron Adams. We'll be showing off the kinds of things you can get for free from the various JavaScript libraries on offer from Google, Yahoo! and others.

  • Fundamentos Web 2006
    (Web Foundations 2006)
    Oviedo, Spain October 3-5 2006

    I'll be presenting a talk entitled "Coping with the New Web on the Server Side", in which I'll look at some of the ways in which the new wave of AJAX-powered rich web applications affect server-side developers (whether they know it or not).

Oh, and if you're in Melbourne tonight, stop by the Web Standards Group where you can eat free pizza while I stroll down memory lane, presenting a history of techniques for producing rounded corners on the Web.

Top


Google Web Toolkit: First Look

Have you written your own AJAX framework yet? It seems all the big boys are doing it. Microsoft is bringing us Atlas for ASP.NET, Yahoo!'s User Interface Library is open source, server agnostic and beautifully documented and Adobe is working on Spry, which is off to a shaky start in the web standards department. Do we really need another?

Google's late-but-inevitable entry into this arena is certainly no copycat. The Google Web Toolkit (GWT) is nothing less than a completely original approach to web development that allows server-side Java developers to take their skills to the JavaScript domain... without having to write any JavaScript.

In short, you write, test and debug your client-side code in Java and then use a specialized compiler to convert it all into cross-browser JavaScript for use on your site.

How's it work?

You can write you client-side code using the usual core Java classes in the java.lang and java.util packages, as well as a nice library of classes that come with GWT that let you access the same browser features that are available in JavaScript (the Docment Object Model, alert boxes, setTimeout, XMLHttpRequest, etc.).

GWT Menu Bar WidgetYou also get a bunch of Java classes for adding widgets to the page, from simple buttons to complex drop-down menus and trees. All of these widgets offer events that you can subscribe listener objects to, and write Java code to respond to them.

When you're ready to test out your application in a browser, you simply compile your classes in your Java IDE of choice and launch the GWT Shell, which pops up a specialized browser window and loads your application. On Windows, that browser window uses the Internet Explorer rendering engine, whereas on Linux it uses Mozilla.

The GWT Shell acts as a go-between between your Java classes and the special browser window, allowing your application's client-side logic to run within the browser even though it is implemented in Java, not JavaScript. This small miracle actually lets you test and debug your client-side logic as you would any other Java code! Set breakpoints to pause and step through client-side event handlers, write unit tests to verify that your user interface works as designed. It all just works.

At this stage, your application is still a collection Java classes, and the final development step is to compile those classes down to efficient cross-browser JavaScript code. The compiler that comes with GWT actually reads the source code of your classes and generates the equivalent JavaScript code!

You can then take the generated JavaScript code, along with your static HTML, CSS and image files and dump them on a server as you would for any other web site. The resulting code is entirely self-contained -- no browser plugins or special server technology required.

Read on after the ad for GWT's slick AJAX support...

Top


Jump right in. Start building web sites with CSS.

Dreamweaver boxJump right in. Start building web sites with CSS.

Tip: Since users may want to view your web pages on screen or printed out, create specific style sheets for these media types. Use the new style rendering toolbar in Dreamweaver 8 to switch between style sheets to preview your page in different media types.

Discover more best practice tips, including:

  • Tutorials and articles on using CSS with Dreamweaver 8
  • Case studies on building CSS web pages with Dreamweaver 8
  • Online Seminars, including CSS guru Dave Shea

Click here for more best practice tips right now.

Top


What about AJAX?

As I mentioned, the class library does give you access to the XMLHttpRequest object normally used in AJAX applications, but GWT also offers an even slicker method of communicating with the server.

In addition to your client-side code, you can write Java server-side code. Because it doesn't get converted to JavaScript, this code can use the full capabilities of the Java platform, and any additional class libraries you may require.

In your client-side code, you can set up classes that are able to communicate with your server-side code. When your application is compiled, GWT will automatically generate all the JavaScript needed to communicate with the server on the client-side, and will compile your server-side code to a set of Java Servlets.

You can deploy these Servlets on any Java web server, and let GWT do the rest. GWT manages the conversion between JavaScript variables on the client-side and Java objects on the server side, and again it all just works.

Sticking Points

Google has definitely put together an impressive platform with GWT, but as one would expect (especially from a beta product) it's not perfect:

  • GWT detects and supports browsers by their user agent string. You must rely on Google to add support for future browsers. Right now, for example, GWT applications are incompatible with IE7.
  • The bundled GWT widgets make extensive use of tables for layout.
  • GWT was written to work with Java 1.4 or later, and as such does not take advantage of Java 5 features like annotations and generics. This adds some redundancy and bulk to the code you must write to use the AJAX features.
  • By masking the client-server division, GWT could lead unwary developers to make some serious security blunders. You really need to know what you're doing to use GWT effectively.

But the biggest thing lacking in GWT is an example of a finished, real-world application running in the wild. No doubt Google is hard at work on its next big project using GWT, but for now at least GWT is unproven technology.

Top


It's amazing what Google has accomplished with GWT, but this AJAX platform for Java developers must still earn its stripes in the cut-throat JavaScript toolkit arena.

See you in fourteen!

Kevin Yank
techtimes@sitepoint.com
Editor, The SitePoint Tech Times

Top


Help Your Friends Out

People you care about can benefit from the wealth of information on new and maturing technologies available on the Internet. Help them learn how to do it by forwarding them this issue of the SitePoint Tech Times!

Send this to a friend
 New Technical Articles

Rebuilding Vogue.com.au

David Lewis
By David Lewis

An old content site. Multiple systems. Table-based design. No content management facilities. And a 35-day project timeframe. Faced with these challenges, David and his team redevelop the Vogue Australia web site from the ground up in just over one month. Here, he reveals how they did it, explaining the finer details of the decisions that were made, and why.

Podtastic! Professional Podcasting for the Rest of Us

Jon Watson
By Jon Watson

If you've been sitting on the sidelines of the podcasting explosion, now's your time to step up to the mic! In this hands-on tute, Jon explains the basics of what you need to know about podcasting before walking you through the process of creating, recording, distributing, and promoting your own professional show.

 Techy Forum Threads
 More Techy Blog Entries

Ruby on Rails Blog:
Get on Track

PHP Blog:
Dynamically Typed

DHTML & CSS Blog:
Stylish Scripting

Java EE Blog:
The Daily Grind

Web Tech Blog:
Technically Speaking

Manage Your Subscription Here.

!You are currently subscribed as to the HTML edition of the Tech Times.


CHANGE your email address here

UNSUBSCRIBE from the Tech Times here.

SUBSCRIBE to the Tech Times here.

SWAP to the 'Text-Only' version of the Tech Times here.


SitePoint Pty. Ltd.
424 Smith St
Collingwood, VIC 3066
AUSTRALIA


Thanks for reading!

 © SitePoint 1998-2006. All Rights Reserved.

Back to the archives

Newsletter signup

Design, coding, community or marketing? Select the right newsletters right for your needs...