My team is embarking on its very first GWT project. We are fairly strong with Swing applications, with almost all of our work involving significant Swing GUIs.
However, this is our very first foray away from the Desktop and to the Web, and the project requires us to use GWT. The project itself is pretty straight forward, the only unknown to us being replacing the Swing UI with the GWT UI.
What pitfalls should we watch out for?
I can think of a few:
Not using GIN and Guice. Dependency injection is very, very useful. GIN (Guice for GWT) isn't documented very well but is worth the time investment spent getting it to work.
To expand on what Cletus said about "certain classes", you do not have a full JRE on the GWT client-side. (Remember, GWT Java client code is translated to JavaScript.) This means that third party Java APIs will often not work client-side. They need to be ported for GWT. So much for write once, run everywhere. See here for more information about this limitation.
Different browsers have quite different performance characteristics, so you'll have to test against different browsers even though GWT generates Javascript workarounds for browser differences.
Creating DOM elements can be very slow in some browsers. If you have large-ish tables (dozens of rows) that change frequently, the browser can become unresponsive if you just delete all the rows and recreate them. We had to write a diffing algorithm to efficiently update tables when new contents were fetched from the server.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With