Just in case you havenâ€™t seen it yet: there is very interesting talk from Ray Ryan available online:
A common question people ask is how to architect a GWT app. Ray Ryan discusses real-world learnings and patterns from the Google AdWords team and elsewhere which you can use in your apps.
While dependency injection on the client side in general is nothing new, having it on a GWT application (I mean on the client) is something a little harder to setup. Since we donâ€™t have reflection and dynamic proxiesâ€¦ But GWT provides an alternative called deferred binding, and there is a project called Gin providing the Guice DI approach for GWT apps.
There are some other projects like gwt-dispatch and gwt-presenter that where created inspired by Ray Ryans talk.
So if you are doing or planning GWT development, have a look at the video and the following projects:
- gwt-dispatch: Inspired by Ray Ryanâ€™s Best Practices For Architecting Your GWT App session at Google I/O 2009, this is an implementation of the â€šcommand patternâ€˜ discussed at the beginning of the video.
- gwt-presenter:Â Inspired by Ray Ryanâ€™s Best Practices For Architecting Your GWT App session at Google I/O 2009, this is an implementation of the â€šPresenterâ€˜ part of the Model-View-Presenter (MVP) design pattern discussed in the video.
- google-gin:Â GIN (GWT INjection) brings automatic dependency injection to Google Web Toolkit client-side code. GIN is built on top of Guice and uses (a subset of) Guiceâ€™s binding language. By using GWTâ€™s compile-time Generator support, GIN has little-to-no runtime overhead compared to manual DI.
If you are looking for an easy approach to use Spring in the backend with the gwt-dispatch project have a look at this posting:
If you are looking for a simple and concise approach to use autowire your Gwt-RPC servlets with components from the Spring application context, have a look at this posting:
- mvp4g: all-in-one approach providing annotation basedÂ Event Bus,Â Dependency Injection,Â Model View Presenter,Â Place Service