Migration from Vaadin7 to Vaadin8

Hi , We have one application which is running in VAaadin 7 and using the below data binding classes and data list classes. Item ,AbstractSelect, Field, InvalidValueException OptionGroup, Property ,DefaultFieldFactory ,QueryDelegate OrderBy ,FreeformStatementDelegate, Container.
We would like to upgrade the frmework from Vaadin 7 to vaadin 8 .Is there any backward compatability , so that we can upgrade with minimal code changes insted of rewriting the data binding logic with Vaadin8 components.
Appriciate your help on the same.

it was my job the last months.

good entry is

[https://vaadin.com/docs/v8/framework/migration/migrating-to-vaadin8.html]
(https://vaadin.com/docs/v8/framework/migration/migrating-to-vaadin8.html)

There is a compactibility modus, [the migration tool]
(https://github.com/vaadin/framework8-migration-tool),
you basicaly do not need to migrate the code, but you have none of the benefits ether.

If your aplication is not so big, it may be enaugh.

Out aim was full migration and not compactibility, so we migrate entire codebase until there were no more depricated warnings.

I think we deleted about 20% from code, because we did not needed it anymore.

The bad thing is = we had to do it by hand :slight_smile:

Biggest things were ofcourse table → Grid and Binder.

Hi Vilius.
Thanks.

We are also doing the complete migration.So,if you can help me that how can we do downward compatibility for Item,AbstractSelect, Field ,InvalidValueException, OptionGroup ,Property DefaultFieldFactory, QueryDelegate, OrderBy ,FreeformStatementDelegate classes in vaadin8

These are the classes we are facing issues.

It sounds a bit Generic but i will try Step by step :slight_smile: !

First = There will be no Other Class where you simply change your Imports.

You have to rewrite your code.

Item = is gone. You are ading now columns after columns directly to Grid.

example

grid.addColumn(Person::getBirthDate, new DateRenderer())
      .setCaption("Birth Date")
      .setWidth("100px")
      .setResizable(false);

You have to rebuild the Table with different Structure. Gives the chanse to clean to codebase :slight_smile:

AbstractSelect, Field, now needs a Binder for Validations.

Example

binder.forField(emailField)
  // Explicit validator instance
  .withValidator(new EmailValidator(
    "This doesn't look like a valid email address"))
  .bind(Person::getEmail, Person::setEmail);

binder.forField(nameField)
  // Validator defined based on a lambda and an error message
  .withValidator(
    name -> name.length() >= 3,
    "Full name must contain at least three characters")
  .bind(Person::getName, Person::setName);

binder.forField(titleField)
  // Shorthand for requiring the field to be non-empty
  .asRequired("Every employee must have a title")
  .bind(Person::getTitle, Person::setTitle);

Vaadin has nice Tutorials on that, im sure you will find that :slight_smile: !

Thank You Vilius for your help.

you are welcome.

Just start, no fear.

Error after Error, warning after warning, you will get faster and faster and in the end the satisfactory is great :slight_smile: