Does it make sense to use Google Web Toolkit (GWT) as a full-blown Java web framework?
Asked Answered
L

7

12

I am interested in the possibility that GWT could serve as the basis for my entire presentation layer.

I would be interested to know if anyone has tried this successfully - or unsuccessfully - and could persuade or unpersuade me from attempting this.

Lulu answered 13/4, 2009 at 16:40 Comment(0)
I
7

I worked with GWT about a year ago. At the time it seemed like a great idea, with a number of caveats:

  • I had "gotcha" problems with some parts of the API, that were probably related to the fact that you're coding as if you're in java when in fact you're actually writing for a separately compiled environment that acts like java, so you make some incorrect assumptions (in this case, passing nested values to the front end). I think there was another was rewriting my ant scripts to use a 32-bit jvm for the gwt compile.
  • I spent a bit of time trying to tweak the appearence - we never deployed a finished project so I'm not sure how much work this would've taken to get to a professional level, but it seemed (logically) like it'd be comparable to tweaking a swing interface. maybe a bit more unwieldy, visually, than html.
  • Because the ajax is so hidden from you in the final product, I had some concerns about what I might do if the performance was poor.

That being said,it definitely seems worth playing with, and my experiences were a long, long time ago in internet years, especially given that it's probably much more mature now. It's also worth pointing out that it's a very different (and refreshing) way of developing GUI code from most MVC frameworks, and worth a look if for no other reason than that.

My feeling is that if you're building a high-load professional site with very demanding graphical requirements GWT is probably not a good choice, otherwise ok.

Idyllic answered 13/4, 2009 at 16:40 Comment(5)
My concern was it's not so intuitive to write Java code to generate a visual interface. Doesn't sound like you really had that problem much. Didn't think about tweaking the ajax - that could be too tricky to bother with I would say. I wonder how different GWT is from when you used it.Lulu
Not sure why you say this - "My feeling is that if you're building a high-load professional site with very demanding graphical requirements GWT is probably not a good choice, otherwise ok" - is it because GWT is "heavy" in the browser - performance-wise?Lulu
Given the seriousness of your caveats, I'm surprised you're not talking me out of it. But it sounds like you think these concerns are outweighed by . . . what? I'm not seeing many positives here :)Lulu
I'd be leery of using it for high load because the ajax traffic is tightly wrapped and not in my control- it might actually be fine. As for the graphical -I'd hate to be in the difficult position of trying to match the client's mockups with swing-ish generated gui code.Idyllic
I see what you mean about the graphical complications. I assume the experts have figured out a way around this. But getting help might be tricky since it's not so popular. Thanks.Lulu
S
2

You mentioned that GWT would handle the presentational layer. Would you be doing the business layer in Java too? If that's the case, I'd like to point you towards IT Mill Toolkit, that does exactly this: It's a toolkit that uses GWT to render its GUI components, allowing you to do your applications entirely in Java. I think the term it's trying to coin is "server driven RIA".

I come from a PHP background, but instantly came to like the toolkit. But it's probably better that I won't say anything more and let you do your own decisions.

Disclamer: I do work at IT Mill, although that's irrelevant to my opinions.

Sliver answered 13/4, 2009 at 16:40 Comment(3)
Probably not if it costs money... the post is CW though, so it doesn't matter what people think :)Machzor
Bill: the toolkit is free as in beer and open source. Oh, and I'm not worried about reputation, CW or not. I just was puzzled the reactions. I mean, if I would've kept it a 'secret' that I, indeed, do get paid by my company, would it been better? Would've probably just gotten fried harder, if someone would've noticed what I omitted, I guess.Sliver
If a google employee came on SO and pointed out some hot new feature of GWT, would they get downvoted too?Mallee
E
1

We have developed a large HR Portal application with the whole presentation layer done in GWT. The backend is Spring. It all works very well and the UI has been very well received by users. Very importantly it is easy for us to add new functionality and maintain the application. I think it would be much harder to do something comparable and maintainable using Javascript libraries.

You do need some sort of client side framework or you will end up writing one (as we did!): Our app is built on GWT Portlets (free and open source).

We use HTML fragments for skinning the app for different deployments and the layout of each "page" is stored in an XML file.

Eliason answered 13/4, 2009 at 16:40 Comment(0)
N
1

We have done this for a very large project, and as long as you know it's limitations, strengths and weaknesses it works great. Funnily enough presentation was the least of our hassles, as we just skinned it just like you would any other HTML page, using CSS. The project went live, and ran flawlessly so I have no complaints.

The pitfalls I found with it you can find here:

Biggest GWT Pitfalls?

Nike answered 13/4, 2009 at 16:40 Comment(0)
S
1

GWT is relatively new. The compiling process tends to get kinda slow as your code base grows. When we worked with it we found many problems with the layout and rendering of more sophisticated widgets, and the emulator acted totally different from real servers. Also, we had trouble with i18n for right-to-left languages...

All in all, GWT has (the usual?) problems of young technologies. However, it does make certain things really easy, like Ajaxifying as you named it.

Selfreliant answered 13/4, 2009 at 16:40 Comment(4)
I'm surprised to hear this. How experienced are you with Java technologies?Lulu
Yes, I meant Java in general. I wasn't sure if your troubles were a result of unfamiliarity with the Java way of doing things.Lulu
But it sounds like the technology may have been the culprit in this case.Lulu
Thanks for raising this red flag. I will definitely move cautiously with GWT with this in mind.Lulu
U
0

some good info on about that on this raible video: http://raibledesigns.com/rd/entry/my_drunk_on_software_interview

Unheardof answered 13/4, 2009 at 16:40 Comment(0)
C
-1

GWT in it's self is a UI enhancement library, not a framework. If you use it with Google App Engine you then have a basic framework. (That is a different story, and while I looked at it, I decided not to include that into our architecture).

It is a great library, we have done some spectacular things with it. As it is a library however, it is only as good as your architecture allows it to be.

As far as ANT goes no problems with a 64 bit compiler.

<java failonerror="true" fork="true" classname="com.google.gwt.dev.Compiler" dir="${dir.GWTCompile}"> <-- dir.GWTCompile is the directory containing GWT --> <classpath> classpath </classpath> <jvmarg value="-${gwt.maxMem}"/> <arg value="@{gwt.baseModule}" /> <arg value="DEBUG" /> <arg value="-strict" /> </java>

As far as the generated code, it is all there in your war if you want to look through it. (It is also open source, so you can look at it there.)

What GWT does during the compile process: It creates several copies of JS libraries for different browser sets (One reason it can take minutes to compile), you can add/remove these as needed. This reduces the JS package that needs to be downloaded and increases the speed as it does not have to have those nasty if (EI) this else if (FF) that. However when your doing local debug (at least in eclipse) you don't have to wait, allowing to leave that for the build server (or when you need to manually build and deploy (neanderthals)).

The downside of GWT. As it is a javascript client side (almost purely), you cannot utilize it for things that do not support it, or support one of the versions. So for things like iPads and iPhones you can run into some issues if you don't use additional libraries designed to bridge those gaps (like mgwt).

Clang answered 13/4, 2009 at 16:40 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.