TechHui

Hawaiʻi's Technology Community

Two months after diving in with GWT I would characterize my experience as mostly positive. The Java to Javascript translation is amazing. I have yet to trip up the compiler, even when using complex combinations of generics, anonymous inner classes, etc. This is an impressive feat of engineering. The ability to trivially create rich desktop-like UIs is fantastic. Many thanks to Google for making an entirely new approach to web application programming available to the public. They could have easily kept this internal as a powerful secret weapon. That being said, there is some roughness around the edges. GWT's widgets are very basic so many people use another library called Ext GWT on top of it. Ext GWT, not to be confused with
GWT Ext, is also referred to as GXT. Confused yet? We sure were when we first started researching these libraries. The primary difference is that GWT Ext provides thin GWT wrappers around JavaScript components while GXT is written 99% in Java. They share the popular Ext JS library's CSS and image assets. The GXT Java code is translated to JavaScript by the GWT compiler. I've talked to several developers that went down the GWT Ext rabbit hole first because they have much nicer looking examples. Invariably they find the opaqueness frustrating and jump ship to GXT. Ext JS, makers of GXT, do a poor job of marketing the fundamental differences between the libraries. This, coupled with the naming mess, leads to a lot of confusion. GXT has some very nice high level components (grids, portals, etc.) Their components look great, and work well on all the major browsers, but GXT's design doesn't lend itself to easy extension. For example, many members are private that should be part of the public API. Most of the basic component classes do a ton of configuration in the default constructor making it impossible to customize the behavior. For example, they attach listeners in the constructor instead of calling out to a protected configureListeners method. Often there is no way to undo this because you can't enumerate all the listeners. This forces you to copy large blocks of code for no good reason. Finally, many of the APIs have confusing or bizarre names. Want to line up widgets vertically? Use the RowLayout. GWT is an awesome foundation, but most non-trivial applications require use of a library such as GXT or GWT Ext on top of GWT to provide things like nice grids. These libraries just aren't as evolved as frameworks such as Swing, WPF or Flex. This leaves you with the option of creating your own high level components on top of GWT or dealing with immature higher level libraries. In two years GWT is going to be fantastic. I'd put money on it. Right now its very good, but you have to be willing to deal with the pain points.
Ikayzo - Design • Build • Localize | Web • Desktop • Mobile

Views: 5114

Comment

You need to be a member of TechHui to add comments!

Join TechHui

Comment by Daniel Leuck on October 16, 2009 at 1:15pm
Aloha Alessandro! Thank you for letting us know about your GXT, GWT-Ext and SmartGWT comparison post. You do a good job of breaking down the differences.
Comment by Stephen McMahon on October 16, 2009 at 11:15am
Thanks Alessandro. I just signed up at the URL that you provided and am looking forward to reading that article when I can give it my full attention.
Comment by Konstantin A Lukin on October 16, 2009 at 11:09am
Just being a bit curious, what technique did you use to style your GWT/GXT app? We've had some difficulties in styling GXT, since most of their UI components use custom markup. The only possible way we found so far was to use themes, but we could not find clear documentation as to how that can be accomplished. Any feedback is appreciated. Thanks.
Comment by Alessandro Giannone on October 16, 2009 at 10:57am
Stephen, GXT now has some good examples of how to setup the Loaders and pass them into the Trees. If you download the GXT source code you can find it inside the zip file in the "explorer" folder. You will see the exact data model you should follow in order to populte the tree as expected.
We've managed to do it successfully on our collaboration and content management platform. It's now in Beta, so if you want to take a look. The whole application is actually built using GWT and GXT. It hangs well together and I think it works quite well. Plus the main advantage of using GXT is definetely having the IDEs and programming in Java. Makes development cycles and monitoring / unit testing / debugging much more efficient.
If you want to see what it looks like, we are running a Beta program and I'd be interested in hearing all your feedbacks. To join all you need is here:

http://www.sambastream.com/form/sambajam-private-beta

Also, if you're interested I wrote a short comparison of GXT, GWT-Ext and SmartGWT here:

http://www.sambastream.com/blogs/agiannone/29-05-09/high-performance-gxt-gwt-applications-coding-java-javascript
Comment by Stephen McMahon on March 12, 2009 at 9:57am
Some of the hierarchies that we have contain thousands of nodes so in most cases I use load on demand (expand). That is pretty easy to implement in ExtJs but it looks like in order for it to work smoothly in GXT, it seems you'd have to create a proxy and give that to a RequestBuilder and then create a ModelType and then give that to a JsonTreeReader and then put it all together with a TreeLoader and a TreeBinder. I already have a native method that will give me the JSON data either for each node or for the entire tree.

Their documentation consists of generated JavaDoc and a prayer. I'm confident that given the right amount of time to experiment with it then I could figure it out but time is the enemy here. If I do come back to GXT for this then I'll certainly document what I did to make it run and post it where it can be found by others.
Comment by Daniel Leuck on March 12, 2009 at 9:29am
Hi Stephen. Thank you for the link to Smart GWT. It looks promising.

re: deep hierarchies

Sometimes the best solution to supporting deep hierarchies is to use a simple list that you drill down on by double clicking. In other words, the list shows the current level in the hierarchy. This is how most people navigate file systems. You can throw breadcrumbs and back / forward arrows along the top.
Comment by Stephen McMahon on March 11, 2009 at 10:35pm
I wasted a huge amount of time today trying to populate a GXT tree with JSON data. I punted and went to the regular GWT tree and was able to have it working within 5 minutes but it was just not pretty enough. I don't have the benefit of server side Java so I've been using JayRock (http://jayrock.berlios.de) for doing JSON RPC stuff and it works out very well. The only tiny drawback is that I have to call out to the JayRock stuff using JNSI and do some ugly and explicit JSON parsing, but l'm sure that experience will teach me better ways of doing it as I go.

I need a good way to display deep hierarchies in a web browser and that GXT tree looked very promising, but I'm finding that the plain old JavaScript (non-GXT) tree is easier to use than the GXT one. So I did some searching this evening and found something that looks pretty promising. If you haven't seen "SmartGWT" then take a look here: http://code.google.com/p/smartgwt/. I have not tried any of this yet, I've only just downloaded it (30MB!), but I plan to spend some time tomorrow and maybe this weekend getting familiar with it. If anybody reading this has any feedback on it then please let me know.
Comment by Konstantin A Lukin on November 9, 2008 at 11:20pm
I agree with Dan here. From my experience, GWT-Ext is pretty customizable and has an intuitive API. It surely has very nice examples along with source code, which provides a good development jump start. There are some intricacies, especially with layouts, combo boxes and grids, that make things confusing. Mostly some features do not work as expected, so it does take some time to figure things out as to what works best and what does not. We have used accordions, a lot of complicated forms, ajaxed combo-boxes, and extensive validation. Tree widget is great, especially if one wants to rearrange the leafs, grids are nice. API is very event-driven, so for example, one can add a listener to the store to get updated when data is loaded or changed. Sometimes layouts do not behave as expected. We have used JSNI extensively as a mechanism to talk to Java Applet, which worked out very nicely.
Recently I've done some work with GXT. Very impressive in a way that it does provide a better Java programming model. In a couple of hours I've been able to get a border layout with a grid, toolbars, and images, all without even going through a tutorial or anything, just by example and API. Finally got stuck trying to figure out how to create a series of toggle buttons connected to the same toggle group and eventually had to give up on the idea. Given the direction of both projects, I would continue working with GXT wishing that they do provide a more extensible and robust API. Overall GWT paradigm surely provides the next step to developing Web User Interfaces, it will most likely gain good momentum in years to come.
http://www.alohacruzonline.com/portfolio/com.mygxt.MyGxt/MyGxt.html

Sponsors

web design, web development, localization

© 2024   Created by Daniel Leuck.   Powered by

Badges  |  Report an Issue  |  Terms of Service