A Peek at Google Web Toolkit
By Thomas Krehbiel
· Krehbiel Tech · Sunday, Nov 1, 2009, 8:20 AM · 462 words · from atomapi · shorturl · 9 comments · ![]()
So I'm looking over this Google Web Toolkit thing since someone around here thinks it's the greatest thing since sliced bread. I hate to disappoint but it's conceptually the same as the much-hated ASP.NET WebForms - it's a framework to abstract HTML and Javascript away from the programmer. But instead of .NET and Visual Studio, Google's version is based on Java and Eclipse.
Unfortunately this abstraction is pretty much exactly what I'm getting tired of in ASP.NET. Microsoft went to great lengths to build this huge Web Forms framework to try to make HTML development look exactly the same as Windows Forms development, and I think there’s a growing body of evidence to support the assertion that it was a mistake (hence ASP.NET MVC).
So, not to be outdone, Google built this Web Toolkit to make HTML look like X-Windows widgets. Deja vu.
So setting aside philosophy and getting into practicalities, the first thing I'm noticing about GWT is that there doesn't seem to be any way to build an interface declaratively. All the examples in the Showcase build things programmatically. That harkens back to the early 90s when it took a thousand lines of code just to make one little gadget on the screen. (Not to mention the inability to separate designers and programmers on the same project.)
Second thing I'm noticing (which is related to the first) is the almost 100% reliance on Javascript for the finished product. The HTML host page is basically empty except for a <script> tag*. I like Javascript as much as the next guy, but I'm nowhere near the point where I think all web apps should be 100% pure Javascript. Maybe it's better for the Googles and Facebooks of the world to offload all the processing onto the client, but is it really necessary for every web site?
(Yeah, I know I was just talking about Silverlight which is all client-side processing, too. But that’s different. :)
* Okay I see that you can insert GWT functionality into any element of the HTML, it doesn't have to be the entire page. But it's hard to think of scenarios where that makes sense. The only reason I can think of is to plug in one of the fancy GWT widgets (like the TreeView or RichText) somewhere on an existing page. In that case, though, it would be just as easy to plug in some Javascript.
Basically I'm not seeing why this is the greatest thing since sliced bread, or why this is better or even as good as ASP.NET. But I guess if already prefer Eclipse and Java, it’s probably worth checking out, so you too can experience the disappoint and frustration that ASP.NET developers have.
Reader Comments
Add a Comment
| Name: | (optional) |
| Comment: | |
Comments are the property of their respective owners.
1. Sean/Red said,
Ok, this may be a bit of a ramble but here goes:
You have some points that I'll give you, but I think GWT excels where ASP.Net web forms fails. Web-Forms had admirable goals. A component model is very valuable: it allows for easier code reuse and create an ecosystem of reusable components, like controls, etc. Web-forms is a failure for many reasons, mostly the introduction of AJAX into its existing model.
GWT Excels because it build a component model (among other things) solely around AJAX technologies. Thus offers a more transparent method of AJAX style applications; whereas web forms you need script managers, update panels, blah. With GWT your client side code is written in JAVA and it is compiled (shrunk, optimized, etc for each browser) to JavaScript. A single language for writing your app is HUGE. At least it is for me where I am responsible for several reusable libraries and managing a team of developers.
Many people, especially the tech savvy, rejected Web-forms, but not because it abstracted your HTML or offered a component model, but because the complete web-forms solution made life difficult in complicated situations. As a result, MS is trying to please the “tech savvy” with a MVC framework; first, MVC for the sake of MVC is dumb, use it wisely. Second, I have yet to find a GOOD MVC implementation. Almost all of the MVC frameworks (Java and .Net) maintain loose contracts between the model, view and controller; leaving each tier (mostly the presentation/view) playing guessing games. Design by contract is a good philosophy and until an MVC implementation utilizes them, I aint interested.
Check out the “Crux” (http://code.google.com/p/crux-framework/) framework if you want to build GWT apps declaratively. Check out GXT (http://www.extjs.com/products/gxt/) & SmartGWT (http://www.smartclient.com/product/index.jsp) for a free set of NICE GWT components.
Sunday, Nov 1, 2009, 4:18 PM
2. Sean/Red said,
Finally, to complete your evaluation of GWT I think you should focus on HOW GWT works, versus how it lets you write web apps. Its an impressive framework. I believe I emailed a couple links, you should check them out.
Sunday, Nov 1, 2009, 4:20 PM
3. Tom said,
You're wrecking my vision of comments as 1- or 2- liners. I had to add some logic to markup the comments better. :)
> A single language for writing your app is HUGE
I agree there.. that's a plus for GWT. And the seamless AJAX is nice if you *need* to write an app that's heavy on AJAX, but most of the apps I've ever done don't need anything but a dash of it. (IMO there's a danger of using too much AJAX - like Suntrust's home banking pages for example, which are not the slightest bit improved by AJAX.)
> first, MVC for the sake of MVC is dumb, use it wisely
I'm not much of a purest about MVC implementation. I just think of the ASP.NET MVC framework as a convenient way to get rid of postbacks. Whether it's "true" MVC or not doesn't really matter to me.
> Web-forms is a failure for many reasons, mostly the introduction of AJAX into its existing model.
My biggest problems with Web Forms are the cryptic component life cycle and the godawful headache of ViewState management. Also Visual Studio's weakest area happens to be in the web designer.
Monday, Nov 2, 2009, 6:54 PM
4. Tom said,
> I think you should focus on HOW GWT works
I disagree.. how a framework works is less important than how you use it. Also I'm not sure converting Java to Javascript is all that revolutionary. I'd much rather Google put that effort into running Java VM bytecode on the client-side (that can interact with the DOM).. THAT would be revolutionary. (Ditto for .NET CLR code.)
Monday, Nov 2, 2009, 7:08 PM
5. Sean/Red said,
I can see how my comment regarding "HOW GWT WORKS" was not well stated. I agree with you 100%, frameworks exists for your productivity, how they work is mostly irrelevant.
I think what I was trying to say with that statement is how friggin cool GWT is :) It has such a lofty goal, and it achieves it so well!!
You don't need to use the AJAX portion of GWT if you don't desire. You can also use UiBinder (http://code.google.com/p/google-web-toolkit/wiki/UiBinder) to declaratively create your UI and rely completely on request / response. You can then take advantage of the other benefits GWT offers like Client Bundles and Spriting.
Or even just to use the rich data entry controls. Do you know how neat it is to have a text box with a mask input? IE: (###) ###-#### ? Very helpful. I know these exist in other frameworks, but GWT just does it better. Stop looking. :)
Monday, Nov 2, 2009, 9:17 PM
6. Tom said,
You sound a little biased. :)
The bundling/spriting/whatever thing *is* cool, but it's not unique to GWT.
Pssst: http://www.asp.net/AJAX/AjaxControlToolkit/Samples/MaskedEdit/MaskedEdit.aspx - it's actually one of the easier AJAX-y things to do in ASP.NET. :)
I'll still take a look at GWT, but I really wish they (Google and/or Microsoft) would stop trying to force everything into HTML+Javascript and develop a whole new way to deliver managed code to a client.
Monday, Nov 2, 2009, 10:50 PM
7. Sean/Red said,
I'd just like to point out, I've been saying that for years. HTML just needs to die.
Monday, Nov 2, 2009, 11:04 PM
8. Sean/Red said,
Ahh clarification: our thinclient as we know it needs to just die :)
Tuesday, Nov 3, 2009, 8:16 PM
9. Tom said,
I say go back to VT100 terminal emulation! Actually now that I think about it HTML isn't bad as a layout model, it just stinks as a platform for interactive applications.
Tuesday, Nov 3, 2009, 8:28 PM