Announcing SmartGWT
Yes, it’s true! A project has been underway for some time to create a GWT (Google Web Toolkit) wrapper for SmartClient.
The project, dubbed SmartGWT, will be made available under the same LPGLv3 license as SmartClient LGPL, with commercial licensing available as well. It will be hosted on Google Code with public SVN access, and external committers will be welcome to participate as with SmartClient LGPL.
We are happy to say that Sanjiv Jivan, the creator of another popular GWT wrapper, is involved in the development of SmartGWT. Sanjiv brings expertise in precisely the right areas, and with his help we’ve been able to make much more rapid progress with SmartGWT than would otherwise be possible. We expect a preview release sometime in late October to early November.
Our Approach
(if you’re asking ‘what is GWT?’ read “Why GWT?” below)
Anyone who has looked deeply knows that SmartClient is a vast, very complete system – a recent count is that SmartClient supports more than 4000 documented, supported APIs. Translated to Java, this number will be far larger.
For this reason, we’ve taken an approach of generating GWT code from SmartClient’s documentation, combined with hand-coding portions that can’t feasibly be generated. By tweaking our documentation set to contain additional metadata (some of it GWT-specific), we’ve been able to generate code you might not otherwise expect, including things like enumerated constants and convenience constructors.
What this means is that the first release of SmartGWT will provide the complete SmartClient API, fully documented. Out of the gate, SmartGWT will be the most complete GWT platform in existence. And of course, all future versions of SmartGWT will match the API set of the latest SmartClient release.
Why GWT?
GWT allows you to write Java code which is translated to JavaScript by a special compiler, so that it can be run in the browser. This is best explained by example:
You write Java like:
import org.smartgwt.client.*; import org.smartgwt.client.widgets.Button;
...
Button button = new Button("myButton", "Click me"); button.addClickListener(new ClickListener() { public void onClick(ClickEvent event) { ISC.say("Hello World!"); } });
This means the same thing as:
isc.Button.create({ ID:"myButton", title:"Click me", click:"isc.say('hello world!')" })
There are many approaches for “hiding” JavaScript behind a server-side Java abstraction (such as JSF, JMaki, etc). All these approaches have a common flaw that any code you write in Java requires a trip to the server to execute. The more customization, the more trips to the server, throwing away the primary benefits of Ajax (scalability and responsiveness). In these frameworks, something like a custom drag and drop interaction is essentially impossible – it’s not realistic to contact the server every onmousemove().
GWT differs fundamentally from these server-oriented Ajax approaches. In GWT, the Java code you write actually executes as JavaScript in the browser. So you can write event handlers, drag and drop logic, even custom subclasses of SmartClient widgets, and all of this code executes in-browser, exactly as though you were using SmartClient directly via JavaScript.
In a nutshell, with GWT you get the robust toolset of Java and the performance and scalability of a true “smart client” architecture.
It’s also important to understand that, although you are using Java instead of JavaScript to build your UI, you aren’t tied to a Java server. You can use SmartGWT with any server technology supported by SmartClient itself, including XML or JSON services built in PHP, or WSDL web services. And that combination is still an entirely free, open source offering.
Get Involved
If you are interested in getting the absolute first available sneak peak of SmartGWT, or if you are interested in getting involved in the project, send email to smartgwt at isomorphic.com.
In the meantime, it’s important that anyone choosing platforms right now knows about this very compelling option. Please help us spread the word – to your colleagues, and to the Ajax blogs and sites you read most!
Thanks,
Charles