February 17, 2010 - zenoconsulting
I gave a talk February 17, 2010 at the Detroit Java User Group and the same talk on February 23, 2010 at the Ann Arbor Java User Group.
The slide deck is here.
The purpose of the talk was to give a brief intro to GWT, and describe some best practices and anti-patterns to avoid when developing with GWT. I also built a demo GWT application that demonstrates:
- Model View Presenter
- UiBinder
- Navigation
- History
- Security / Session Management
- GWT-RPC
- CRUD with mock persistence layer
- Spring WebMVC and Dependency Injection
The demo project is hosted on GitHub at http://github.com/davisford/gwt-demo.
Feel free to clone it. If you haven't used git, its pretty simple. http://learn.github.com/ is a great resource. If you install the git client, you can pull it down via:
$ git clone git://github.com/davisford/gwt-demo
or for the slower http protocol
$ git clone http://github.com/davisford/gwt-demo
It is a maven project. You can import it into eclipse easily via:
$ mvn eclipse:eclipse
Then in Eclipse: File -> Import -> Existing Project into Workspace -> Navigate to the Directory where you cloned it.
You will also want to install the Google Eclipse Plugin. This will allow you to run/debug the app directly from Eclipse.
If you want to run the demo in hosted mode from maven, you can do this:
$ mvn gwt:run
This should launch the hosted app. From there you can launch the app in the default browser, or copy/paste the URL into your favorite browser. The first time you do it, if you don't have the GWT browser plugin, it will prompt you to download and install it. After that when you refresh you should see a login screen.
Username is hardcoded in a map in the source, since I did not implement a real persistence layer. You can login with davis/davis or homer/homer.
I'll likely add more documentation to this, and probably evolve the code more as time permits. If you have questions about it or GWT in general, contact me via email or add a comment on this page, and I'll respond.
Backlinks
Add one blog page
Tags
git clone http://github.com/davisford/gwt-demo
should be
git clone git://github.com/davisford/gwt-demo
Heya - it should work either way, although the git binary protocol is indeed much more efficient.
hey David,
I have little experience with GWT. I recently discover Vaadin a framework based on gwt but the presentation is all in the server side.
It seems to be intriguing. The only think I am afraid is that the vaadin apps tend to be chatty than that of regular gwt app since you put
all UI logic in the server side.
Did you know about this framework and what do you think?
Doug
Hi, I had not heard of Vaadin. I took a brief look at it. My immediate first reactions are 1) why would you need another abstraction on top of GWT? 2) why bring back in server-side presentation logic, and do it with GWT which is client side presentation logic? If you really want server side presentation logic, why not just uses Struts, Rails, or any of the other frameworks out there that already do this.
I guess I'm kind of missing the big picture on what their project is aiming to solve, but admittedly I didn't spend a lot of time reading their documentation.
IMO, Vaadin does not add any additional abstraction on top of GWT. When you use Vaadin, you use GWT without compiling java -> js and html.
The nice thing about Vaadin is that since the server handles the rendering, you can control data binding with ease. I'm especially interested in the fact that there is no restriction on what packages in the JDK you can/cannot use.
Anyway, I am just a beginner both in gwt as well as Vaddin. There concept sounds solid.
If you can recall, Echo2 attemps to do the same thing. But they haven't released anything since the beta of Echo2 in 2007
Post preview:
Close preview