Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Spring + Vaadin integration design patterns

What design patterns are used when integrating spring with vaadin/gwt? We're using spring with hibernate in our application, every dao is a spring bean. Question is what is the best way to use them on Vaadin side?

Options which we've find so far are:

  • making all vaadin controls spring beans (sometimes might be hard..., using prototype scope etcc)
  • using compile time weaving - however it is very annoying to run maven install after every change when compilation takes a few minutes
  • load time weaving seems to conflicts with atomikos
  • creating some bean manager, which has autowired all needed daos and return its instance like in a singleton
like image 827
mmatloka Avatar asked Aug 30 '26 12:08

mmatloka


2 Answers

Try my Spring Stuff Vaadin Add-On, which has some helpful classes for integrating Vaadin and Spring.

There is a demo on GitHub that shows how it works.

like image 106
Archie Avatar answered Sep 01 '26 06:09

Archie


I would recommend using Vaadin UIProvider mechanism. This way autowiring in UI is totally transparent.

You can have a look at a really simple example that uses this solution on github: spring-vaadin-example

like image 23
mendlik Avatar answered Sep 01 '26 06:09

mendlik



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!