Is the Google Web Toolkit Right For You?
An anonymous reader writes "The recently released Google Web Toolkit (GWT) is a comprehensive set of APIs and tools that lets you create dynamic Web applications almost entirely in Java code. However, GWT is something of an all-or-nothing approach, targeted at a relatively small niche in Web application development market. This article shows you what GWT can do and will help you decide if it's the best tool to use for your web development."
...because I can't program :-)
34
I, for one, welcome our weather-reporting overlords.
+5, Truth
I think that's how ASP.NET components have worked for years too. So, I wouldn't say that it's unusual unless you're coming from a completely "my text editor is my development environment" world.
I'm guessing that Google will.. (?)
Does it have a "I'm feeling lucky" feature, where it will deploy your project for the first time without bugs?
In other words, if you want to make sure your site "just works", GWT isn't a good technology to use. If your management team is paying attention, that should pretty much stick a fork in this technology.
You haven't seen bad OO code? (maybe YOU'RE the bastard who writes it) You don't know how to write good non-OO code? It exists.
There is an OO equivalent to spaghetti code, and it's fearsome.
From a web developer point of view, and as the article states several times, the Google Web Toolkit uses an approach similar to Swing, code written for GWT feels like GUI code more than web code, while I don't have anything against this and I believe it does have audience, I think many would prefer a more web-like approach such as Prototype or the Yahoo UI library.
python>>> q="'";s='q="%c";s=%c%s%c;print s%%(q,q,s,q)';print s%(q,q,s,q)
Using GWT is far closer to developing with Swing or SWT than the usual experience of Web application development,
As if GUIs in Swing or SWT weren't slow and clunky enough. Now Java developers have a slower and clunkier alternative. Yay!
-matthew
"THERE IS NO JUSTICE, THERE IS ONLY ME." -Death
Thats my biggest beef with the way this kit works. The JSNI interface seems like a pure hack to start with doing things like embedding javascript code in a java file using code like the following:
I find these kinds of toolkits get you up and going quickly, especially if you are new. However, the first time you run into something the toolkit can't handle, the black box nature means your SOL.
I had to stop after the third line... "Level: Advanced"
I mean, I tried to make it work, but I couldn't ever get her to give me a callback...
I think that's how ASP.NET components have worked for years too.
Not to mention EchoPoint.
It's a good idea, but the devil is in the details.
App developers are overwhelmed with details they have to manage. And we all know that the essence of good design is not having to worry about details until the appropriate time. The flip side is when you do focus on some other details you'd been ignoring up to this point, you don't want to have to worry about details you've already taken care of.
So, the idea is that programmers should be able to program with your framework without worrying that they are doing something web based. That's good. But the flip side of that is that designers should be able to design without worrying about the fact the programmers are using your framework.
The problem with past attempts at this paradigm fall short of ideal because they enforce non-standard or proprietary ways of doing things. They may be good enough, but they could be improved on.
Post may contain irony: discontinue use if experiencing mood swings, nausea or elevated blood pressure.
What do you think when you hear "Code Generator?"
... if it's possible ... I'll delete as much of the auto-generated code as possible and start from scratch ...
Great for college research (took multiple classes on it)... but annoying in the real world
The main difference is that ASP.NET generates the HTML/Javascript at runtime, whereas GWT compiles Javascript applications beforehand. So performance on the server is not affected by Java at all -- seems like a good use of a managed language.
.NET code on the server at runtime, generating rich client side widgets and managing the client-server communication. It's sort of like a cross between GWT and ASP.NET, I like it because it gives you the full stack of language functionality, and server functionality when you want it, rather than restricting what available libraries you can use when you're writing your code.
I'm working on a project that exposes a similar code design environment to GWT, but does so in managed
The project is GPL'd, and the website is www.emergetk.com if you're interested.
--ben
When I hear someone say what you said I think... "another hack who's never programmed anything, never will, but read some shit on slashdot about it and now believes he's an expert"
There's plenty of unreadable, unusable OO code out there, as well as plenty of well performing Java.
I don't need no instructions to know how to rock!!!!
> What do you think when you hear "Code Generator?"
:)
Perl 6. Perl 6 will be compilable to JavaScript, so you can write your web applications completely in Perl
My other car is first.
This is exactly the reason I gave up on VB. Want to do something even mildly handy (say, check the amount of free space on a disk)? Better figure out the WinAPI call format and figure out how to cast your arguments to FAR_WPTR[1], 'cause VB itself is absolutely worthless for this. OK, so you're not totally SOL, but if you don't have some experience with cross-language subroutine calls, you'll be pulling your hair out for days.
[1] Not a real data type. Not that UINT8 is any better...
Just junk food for thought...
There's been several JS code generators recently. Apart from GWT there's also haXe which is more ambitious. haXe can also be used on the Server Side and includes some facilities for Dynamic programming (whereas Java is strongly typed 100% of the time).
Also, what's the state of the art in screen readers? Do they have sufficient JavaScript support? (*)
If not, using GWT for a corporate web site is just a lawsuit waiting to happen.
(*) This is not an idle question, I'm sincerely interested in real answers and pointers to software.
GCHQ Quantum Insert installed. If only our tongues were made of glass, how much more careful we would be when we speak
We've already got an MVC LAMP architecture here at work and I have limited Javascript development until the framework was further along. But now the designers are getting edgy because I won't let them incorporate Javascript.
My issue was that I wanted a unified javascript library so we didn't have redundant code snippets all over the place and some way to standardize the development. So after a little searching, I found the Yahoo UI toolkit that is still in beta. It's a unified javascript library released under a BSD license that has been tested in multiple browsers.
No I have a unified library, tested in multiple browsers and standardized that all I have to do is drop into a directory and hook into the framework.
I know this is probably unrelated but since we were talking about toolkits, I thought this would be handy to mention this as well since it saved us a month of work.
This is my sig. There are many like it but this one is mine.
I'm too lazy to type it twice
We are taking advantage of it. We really look forward to the ability to develop rich Web Apps using a standard IDE and Java "OO" paradigm. ==== Beaches & Casinos: http://buddytrace.com/
http://buddytrace.com/
When I saw the announcement I was initially excited... then I saw that the first stage was to write a Java Swing application.
Well, I'm writing a Java Swing application at the moment for non-GWT purposes, and it's a horrible, painful process. I'd rather write raw HTML and JavaScript any day. It's not just a Swing issue; there are still too many things in Java that are way, way more difficult than they ought to be. (Like date and time handling, for instance.)
I really wonder why they built this thing using Java as the source language, when they could have chosen something easy and painless to learn and write like Scheme, Ruby, Python, or even (shudder) BASIC.
GCHQ Quantum Insert installed. If only our tongues were made of glass, how much more careful we would be when we speak
Umm... Java IS an Object Orientated language... (unless you mean something else by OO, in which case I would love to be enlightened..)
--Valthan
There are developers who still use VI for Web developments :)
GWT is the heavy favorite to serve as the core for our new webapp.
====
Beaches & Casinos: http://buddytrace.com/
http://buddytrace.com/
There's not a lot of tolerace for criticism of corporations, is there?
I think that most coders feel the same way.
Wikileaks, no DNS
Yes ... Java is an OO language ... Java != OO
No
Thus it's ok to have different opinions on them.
OK, Now I am confused... Who wants to explain to the first year CS student?!
--Valthan
When I hear "code generator", I think compiler.
Hmm, all the examples in the article look pretty much the same than they were written in JavaScript, but in a more complex way. Why not actually learn the trade. Its easier to fix problems if you're working with the actual code that runs in the browser, not the "meta code".
Hey, this is a bit of a shameless plug for my open source project, but it's on topic to GWT. Speaking to the subject of the post, regarding the utility of GWT, I point to my API and API like it so say there is probably a larger market for GWT than this fellow is speculating, and frankly from my experience with the interface I don't see how he could reasonablely charictarize it as all-or-none (the project google generates is example of how to integrate google GWT into your current HTML using named elements and replacing them....). Features: Fully implemented all the major classes including the new Geocoder and events. Available for download on SourceForge (http://sourceforge.net/projects/gwt/). For anyone interested in helping help please e-mail me (developers, testers, documenters welcome).
I wrote a VB 6 app in a couple hours that not only notified me of the amount of free space in a given folder (including the root folder), but displayed it in a chart so I could easily pinpoint where all my hard drive space went. Not counting the VB Form, I used two objects: the chart object (crappy, but all I needed) and the filesystemobject object. It took about two hours to get it to where I needed, and I was doing it as a semi-useful learning task (elements of the filesystemobject that I hadn't used before). I imagine it could be done more easily in VB.Net, but I haven't bothered to try.
I'm not saying there aren't better tools than VB out there, or that it is easier to do what you were looking for in VB, but don't pass off your lack of knowledge as fact.
Sure I'm paranoid, but am I paranoid enough?
OO = Object Oriented ... but Object Oriented Programming in general does not (cause for example C++ rocks).
Many computer languages are or can be Object Oriented (Java, C#, VB.NET, C++, etc.)
Therefore Java is a sub set of Object Oriented Programming
Object Oriented Programming is not just Java though, cause as said above it could be C++, C#, VB.NET, etc.
Therefore, I believe it's ok to say then that Java (as a subset of OO) may suck
Well, I tried.
OH, OK, I thought at first he was trying to say that Java was not part of the OO grouping, which really threw me for a loop.
And personally I like Java, (although all I have to compare it to as far as programming goes is VB and Turing so...)
--Valthan
I would never, ever, ever even _think_ of trying to write an Ajax application. I hate javascript way too much for that, and the whole asynchronous web-page dynamicness scares the shit out of me. However, I can stand writing GUI code in Java, and I already have some knowledge of how it works. GWT enables me to write super-cool Ajax websites without worrying a bit about javascript. I think this is the true power of GWT: it enables _application_ developers (rather than web developers) to write nice web applications without learning a whole new skillset. This is a win for developers because we can do cool things without learning a whole new trade, and it's a win for consumers because web apps can be written by skilled application developers instead of photoshop gurus.
Also, just because GWT provides some server-side machinery doesn't mean you have to use it. GWT will happily make asynchronous calls to any old URL, so you can write your backend in PHP or Perl or C or whatever you like. Personally, I've been playing with GWT using PHP/SQLite as my backend (following Juan Hurtado's great tutorial). It works great, and since I'm already comfortable with Java, PHP and SQL, it doesn't require a steep learning curve to create very nice web apps.
That said, I will certainly be taking a deeper look at TFA later and perhaps following its example to learn how to use the Java server-side machinery. Could be interesting.
This seems like a useful article. At work we were just discussing the possibilities of using the GWT. Currently we use NextApp's Echo1 and are also pondering upgrading to Echo2. The demo app for Echo2 is actually mighty impressive; I'd say moreso than GWT's. Though I wonder how much of it is just more time spent on fancy graphics as opposed to a better quality framework.
Does using Java to write JavaScript make you some sort of super Java ninja?
The Computer Science terms you are looking for are "coupling" and "cohesion." A good design minimizes coupling and maximizes cohesion.
Now sadly
Good luck with your schooling
As a disclaimer, I'm a huge fan of Ruby on Rails, and not at all a fan of Java.
The problem with the GWT and other framworks like it as it ignores the reality that browsers today suck. IE's rendering engine is suckier than Monica Lewinsky holding a Dyson at the event horizon of a black hole. Firefox doesn't quite yet pass Acid2, but is as close to a reference platform as one can get. Safari shows promise, but it has a weak JavaScript environment that doesn't support things like ContentEditable. The whole problem is that the GWT assumes a much more stable platform than actually exists.
The real challenge for web application developers is that there are no frameworks (that I know of) that provide for things like fully semantic code, graceful degradation of capabilities, and full separation of content, behavior, and presentation. (For why that separation is important A List Apart has a great article on the subject.) Not even Ruby on Rails gets this right by default.
GWT tries too hard to abstract the actual code that user agents see from the code the programmers create - and that level of abstraction just doesn't work yet. Just like trying to translate a passage in French to English and Japanese with a machine translator, the GWT tries to take Java code and translate it into a mish-mash of XHTML, CSS, and JavaScript - and the results are as mangled as one would expect.
Until someone comes along with a framework that creates clean, semantic code with full separation of behavior, presentation, and content, web application developers have to be mindful of their code and do a lot by hand. Frameworks can save time, but they also cause a trade-off in terms of code quality and compatibilty. The GWT goes too far in that balance IMHO, and isn't something I'd use to develop public applications. Like ASP.NET, it's too reliant on abstracting XHTML/CSS/JavaScript from what the programmers deal with, and that always leads to bloated masses of code that frustrate users and hog bandwidth.
Here's the link for this, BTW:
http://svn.openfoundry.org/pugs/perl5/PIL2JS/
My other car is first.
I'd prefer to see a toolkit that provides unobtrusive JavaScript. Basically, you'd tag (with a specific class) the HTML elements that you'd want to act as UI widgets. Then include the JavaScript file, and the JavaScript file does all the work. This provides graceful degradation -- if they don't have JavaScript, they just get the original HTML. And it lets you use all your standard HTML tools, so your designers can still handle all the look and feel, without having to deal with anything besides HTML and CSS.
Software sucks. Open Source sucks less.
The two things I like about the Yahoo! UI toolkit are that:
- it is a la carte
- it represents pretty advanced, human-readable Javascript, which has allowed me to learn advanced Javascript techniques
The first, a la carte, means that the entire web application does not need to be dedicated to YUI. Recently I incorporated a YUI DHTML window (Panel, in YUI-speak) into an existing ASP.NET application. It required only a few lines of Javascript and some HTML. Ditto for another application (JSF, this time), where I added an AJAX data lookup to dynamically populate sample values in a dropdown list. I love the DOM and Event libraries: they really clean up the cruddy job of adding small DHTML things to a website, regardless of how it's put together.
The second, that YUI is a learning experience, is also very important to me. I've come late to the DHTML game, and most books and tutorials on Javascript deal with the basics, and stuff like OO programming is either glossed over or omitted entirely. However, Javascript is a language that is suited to OO programming in a unique way, IMHO. By studing how the YUI toolkit works and seeing what Javascript is capable of, it has opened the doors for new ways of tackling problems and reducing the number of lines of JS code I write.
HBH
"Smart is sexy." -- D. Scully ("War of the Coprophages")
Now I understand why computer science geeks don't "couple". They have a whole different meaning of the word from the rest of the world ;)
Uses java byte code instead of source so it's more stable. http://video.google.com/videoplay?docid=-317158218 7051229467
Gee, VB's changed since VB5 (when I gave up on it). Who'da thunkit?
Just junk food for thought...
Sorry about the tone of that reply, I shouldn't have assumed that you had used VB as recently as I had. I didn't use VB5, but I did hear some pretty ugly things about it.
Sure I'm paranoid, but am I paranoid enough?
is terence parr's mantra: http://www.cs.usfca.edu/~parrt/papers/mvc.template s.pdf
i've used his http://stringtemplate.org/ in a webapp with pretty good results...even if stringtemplating is itself a form of programming, at least it keeps java out of html:-)
Java's performance isn't "poor" — as is frequently pointed out on this site, this is largely an outdated myth. As for not truly open source, it's a definate issue, yes, although there is open implementations.
Interesting, I'm not really a web developer except for a bit of custom javascript DHTML stuff I've done.
;-)
;-)
(Yes, most of my web experience comes from the days when it was just called DHTML..)
This is the first time I've peeked into a platform like this... it's really interesting how close it is to writing a GUI application, like in SWT or something. (Again, I've only done a little bit of SWT, since I don't prefer Java most of the time, but it definitely has its place.)
But I find it amazing how it seems totally incidental that it happens to use the web for rendering its interface. What it really makes me think of is the possibility of writing multiple back-ends for it. Imagine using it to write applications that can compile to both a GUI environment, using native Win32/GTK/Cocoa elements, and then also be able to easily re-compile to a web application. Not sure there'd be any point to that, come to think of it, but the idea sounds cool for some reason.
Or imagine writing an application which is totally local, but happens to use a browser for its interface. It could embed a mini HTTP server in it.. well, I know this has been done before, but this is the first time I've seen an API that actually makes the idea somewhat attractive to me. It would solve the multiplatform GUI problem by just using whatever browser the user happens to prefer.
Anyways, now if only I could use GWT from Python instead of Java..
(Same goes for SWT by the way.. the PySWT project isn't very useful yet. Sigh..)
Bah. Until certain whiners in the OSS community gets off their asses and work on the existing OSS implementations instead of demanding a non-OSS implementation should be opened up, it's simply not worth it debating with them like that.
It's not like GCC was written by AT&T.
Did you say "Google Web Rootkit"?
You can defy gravity... for a short time
A competing framework Thinwire[www.thinwire.com] has another analysis of GWT.
http://www.thinwire.com/thinwire_vs_gwt.html
Couplin done right results in cohesion.
:D
Sticky, sticky cohesion.
"Times have not become more violent. They have just become more televised."
-Marilyn Manson
Yay for cohesion! Too bad you require to couple first. That's the hard part.
I ... will ... try ... to ... remember ... that ... next ... time.
Perl code can be readable, but usually resembles line noise.... The mere fact that it is possible to write readable perl code does not negate the fact that by design, the language lends itself to unreadable code.
In a similar way, you can write poorly-performing code in any language, but I can't think of any language that has such a high percentage of slow programs. I know that various folks have proven that it is possible to write software that performs reasonably well in Java. However, the sheer number of dog slow Java apps I've used over the years does suggest that there is something inherently wrong with either Java or the design patterns that its use encourages. Whether the problem is a sociological one or a technological one, the blame still lies with Java, IMHO. Thus, while it isn't purely true that Java is slow, it is an accurate characterization more often than not.
My cynical suspicion is that the whole "Java is slow" mentality, coupled with the whole "let the language do all the nasty stuff for me and protect me from myself" mentality has led to a whole generation of lazy programmers who won't spend the time to optimize their code, instead choosing to blame the language. Couple that with people using the wrong level of abstraction to do the job (e.g. passing around a dozen bool values for flags when a single flag integer is more efficient, passing strings around where a single-byte tokenization would be sufficient, etc.) and you get a slow mess.
In a rather ironic twist, Java's simplicity---the representation of everything as a class, lack of pointers, etc.---has led to some really spectacularly bad code---not because it is impossible to write good code, but because C's crudeness often forced you to write good code or crash....
Check out my sci-fi/humor trilogy at PatriotsBooks.
In other words, if you want to make sure your site "just works", GWT isn't a good technology to use. If your management team is paying attention, that should pretty much stick a fork in this technology.
If it's an inhouse app, then there should be no problem. If it's an "app" that's for the public then there should be no problem. If it's a "web site" where the desired goal is to try and be compatible with every possible browser, then the answer is no or serve up different pages upon client detection.
The bottom line is that we live in our browsers so much, that it's very appealing to try and expand the functionality of what can be done on a web page. We'll only see "richer" web pages in the future.
That's not the issue though — the issue was that there's just a stigma around Java now because it was slow in the past (due to a less refined implementation) and because its desktop APIs are generally terrible so desktop apps written in Java tend to be clunky and slow. If you used Java apps a while ago, or Java desktop apps, to gain your opinion of it being slow, you're damned right. But Java itself is not slow.
I'm always surprised with how much weight people put on optimisation. Generally I find that a few days with a profiler will find any serious bottlenecks, and otherwise a well-written system will be fairly performant anyway. Over-optimisation is as dangerous as anything else, and rarely yields positive results.
"Good" code is subjective in this context — I've seen a lot of incredibly poorly-written C code which is that way just because "it didn't work" and was hacked until it did. While its true that generally it's easier to get going with a language like Java (well, other than the verbose nature of the OO implementation), I don't think that this "lower entry requirement" leads to poorer code in general. That's just my positive view though, I realise that a great number of PHP apps are evidence to the contrary here ;).
But yes, Java ends up being slow in desktop apps, a lot of the time. In general, however, as Java implementations get better, even older apps will improve with it.
I believe the way native methods are specified in geniously elegant. It uses the native keyword for its designed use -- to specify that there's a method with an implementation in the interpreter's native language. In the case of GWT, that's Javascript. And instead of extracting the Javascript implementations to an external file where dependencies must be mapped through convention or configuration, the /*-{ ... }-*/ block provides a clean way to put the native methods right into their class. The big problem with GWT is it's difficult integration with existing codebases (it doesn't play that well with others). But the overall syntax of class file definitions is brilliant.
my blog
That feature leaves you in an endless beta :-)
Vista:XPSP2::ME:98SE
No, that's the *fun* part.
:D
Well, ok, done right, coupling requires a hard part.
"Times have not become more violent. They have just become more televised."
-Marilyn Manson
What I don't get is this: Isn't AJAX supposed to require enabling ActiveX support on MSIE browsers? And isn't ActiveX notoriously hacker-friendly? If so then why would anybody want to develop using AJAX?
Slashdot social media options: AIM, ICQ, Yahoo, Jabber and Mobile Text. Why no MySpace?
ASP.NET does not natively do what GWT does. In GWT, you write code in Java and it is converted into JavaScript for the client side. Yes, every AJAX applications will still rely on servlets and yes many of your pages will be rendered on the server: this is where it's similar to ASP.NET. The key is that you don't have to write ANY code in JavaScript unless you need functionality outside the GWT. In fact, they have a very neat interface for "native" JavaScript as well.
In ASP.NET you have to write all your JavaScript in.. well, JavaScript or JScript as MS calls it, which is probably a better name anyway since JavaScript and Java have not very much in common.
GWT is new.
It is a great idea, and it's already been copied in the MS environment, which is good.
Here's an interview with someone in the middle of integrating Google Web Toolkit (GWT) with a Spring MVC application. In the interview Michael Podrazik provides some insight and tips for people interested in starting out with GWT.
------ Tim O'Brien
I actually am one of them, and I'm quite productive, I can code way faster than a lot of dreamwaver users I know, and I'm not even an CS graduate or anything related
VI rules, thank you very much
I'm positive, don't belive me look at my karma