Vaadin 7 with Guice
Vaadin 6 is an excellent UI development framework. Vaadin 7 looks like being even better.
I am most looking forward most to the new navigation features - the logic seems much clearer, and appears to support the idea of multiple Ajax pages (from the user's point of view that is). No more out of sync errors in multiple tabs!
It is a shame in some ways that dependency injection is not included as standard, but I can understand why - it would mean backing a particular DI provider and perhaps shutting out a lot of developers.
We made extensive use of Guice in an earlier project on Vaadin 6, and I became a real fan of the combination. Then I found this blog, which gave me an excellent start (thanks Christian) for integrating Vaadin 7 and Guice.
I have slightly modified the example he gives. I have taken out the GAE element, which I don't use, and added in JUnit testing using Guice. My sample app doesn't do much, but if you open it in multiple tabs it demonstrates the use of Guice and multiple UI instances.
I've also included Guice in the Ivy dependency management, another new feature of Vaadin 7. I had intended to use Gradle as a much simpler alternative to Maven, but haven't got round to doing that - and I may just leave it with Ivy.
The sample code is currently written against Vaadin 7 beta 8, and I will try and update it as the Vaadin releases progress.
No comments:
Post a Comment