Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Persistence with Vaadin

I'm trying to learn vaadin. I'm really confused how to do any kind of application development with persistence because if I have a reference to my service layer objects, they get stored in session and I really don't want that. Persistence stuff just isn't serializable.

My case is that I have an already made application that uses Spring and I'm creating a new UI for it with Vaadin. I can inject the spring stuff to my Vaadin application but that gets stored in the session. Any tips?

By the way how do you post in the Vaadin forums? I can't find a post button or way to register :)

like image 972
palto Avatar asked Dec 13 '25 16:12

palto


2 Answers

My suggestions:

  • Define your containers as only containing presentation data. Don't keep any direct references from your presentation objects to your persistent objects.
  • Define a "load" operation that, within a transaction, loads the persistent data objects and converts them into the corresponding presentation objects that back your container.
  • Make all your containers read-only (following the model-view-controller pattern: the container is the model)
  • Set up notifications/triggers as necessary to reload your containers when the underlying persistent data changes.
  • For scalability, design or use containers that know how to lazy load, etc., so you don't populate the entire container at once (note: difficult with TreeTable - see issue #9516)
like image 120
Archie Avatar answered Dec 16 '25 08:12

Archie


Have you tried this http://vaadin.com/directory#addon/enterprise-app. This add-on use spring and hibernate.

like image 29
Kevin Avatar answered Dec 16 '25 06:12

Kevin



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!