My best practices for Vaadin add-on projects

Datetime:2016-08-22 23:33:20          Topic:          Share

Published Date 8/18/16 6:16 PM

A good software project should be easy to build, fast to develop and it should be simple to test. This is also the case for Vaadin add-ons, which are not the most trivial kind of software projects on the Earth.

The de-facto method for creating Vaadin add-ons is a Maven project template called vaadin-archetype-widget. To tell you the truth, I’m not that big of a fan of it. Most of Vaadin’s own add-ons don’t use that kind of project setup either. The project it generates is a complicated multimodule setup, which is slow to develop with and, most essentially, it doesn’t really support proper testing.

For all add-ons I have created, for both official and my own add-ons, I have typically just copy-pasted the build and project structure from some recent project and adapted it for the new add-on. Slow and error prone. I finally decided to spend some time creating an add-on project template that I could think of using myself. The most relevant differences to the “official solution” are:

  • Single module project by default, much easier to checkout and get contributions.

  • Test UIs are in the same project as the add-on, which dramatically shortens development cycle.

  • Automatically updated UI to list and search relevant test cases.

  • A setup and examples for unit and browser level tests.

  • A separate “light” version for add-ons that don’t use GWT (plain server side or JS only add-ons), which removes a lot of clutter from the dependencies and the build.

Based on my rather extensive experience on both Vaadin’s and my own add-ons, I dare say these new archetypes are the way to go for your next Vaadin add-ons. I'd love to hear feedback on these so that they can serve as a starting point for our next official add-on archetypes as well. If you have tried creating an add-on before, and gave up due to the complexity involved, this might be the day to try it again. Also, you can use them as an example, if you wish to convert your existing add-on project to a similar structure.

Try new add-on archetypes

Matti Tahvonen has a long history in Vaadin R&D: developing the core framework from the dark ages of pure JS client side to the GWT era and creating number of official and unofficial Vaadin add-ons. His current responsibility is to keep you up to date with latest and greatest Vaadin related technologies. You can follow him on Twitter – @ MattiTahvonen

44 Views, 0 Comments

Average (0 Votes)