Vaadin

2022 10 01 head

Vaadin is an ideal solution if you are a Java developer and wants to provide a user interface for your product. Vaadin is a framework to create graphical user interfaces using plain Java, or any JVM-based language for that matter.

You develop in Java, and the framework takes care of all the rest. It generates the client-side code, and the communication between the client-side code in the browser and the backend code on the server.

Your team only needs to program in the Java stack [1]. Your developers focus on their key competencies. This is a huge advantage.

Proficiency is difficult in one technology stack.

Only exceptional individuals really master multiple development environments. You can probably not afford to hire them.

The Vaadin framework is optimal for internal applications.

It scales up to a few thousands of active users.

Progressive Web Applications PWA

User interfaces shall accommodate various screen resolutions. Ideally, you should support phone displays, tablets, and high-resolution workstations. Progressive Web applications provide the functionalities to realize such solutions.

Vaadin provides first-level support for PWA functions.

The regular Vaadin distribution provides the expected regular visual components.

The Vaadin Component Factory distributes more specialized components. These components were before created for a particular customer and later released to the community.

I use the SO-Charts components to draw various charts. This library is a thin wrapper for the Apache project ECharts.

Developing with Vaadin

The most popular IDE for Java is currently the IntelliJ IDEA tool. You develop Vaadin applications just as regular Java applications.

I use Gradle Build Tool as build tool. This approach is well-supported in the IDE. The Vaadin company still seems to prefer Maven as build tool. You find Gradle examples created by the developer of the Karibu library.

I prefer to deploy Vaadin application with an embedded Web Server. The approach has two advantages. First, debugging the application is easier and snappier. Second, the modern production environment builds on Docker images and Kubernetes. You will never deploy more than one solution on a container instance.

Vaadin components do not hinder domain-driven design approaches.

Testing with Karibu

Digital solutions are developed using agile approaches. They are often deployed multiple times every week in production.

The unit and integration tests are run automatically before each deployment. The successful execution of the test suite guarantees no known errors are deployed.

The Karibu test library efficiently supports developers writing Vaadin integration or end-to-end automated tests.

Karibu testing is here to perform:

Containerless testing

You do not need to launch the servlet container. Karibu creates a Vaadin Session, the UI and other necessary Vaadin classes straight in the JVM, which runs your JUnit tests.

Browserless testing

You look up components straight from UI.getCurrent(), bypassing the browser and the JavaScript bridge completely. You directly call methods on your server-side View classes and on the server-side Java Vaadin components.

Learning Vaadin

Vaadin provides training videos.

A certification program validates your learning.

Extensive documentation and tutorials are published on their website. The current examples emphasize the usage of Maven as a build tool. I prefer Gradle Build Tool and had to search the Internet to find clues how to build the examples with Gradle.

Concrete examples of how to realize specific functions with Vaadin are collected in the cookbook.

Beware of selecting examples using the current version of the framework. Legacy code uses Vaadin 8 and is useless for modern solutions.

Very cool is the student program. I am currently trying to introduce computer science bachelor students to the advantages of Vaadin. Students are bombarded with various technology stacks. Java and Vaadin is a single Java-based approach to write more easily semester and bachelor development assignments. The drawback is it is less sexy than React, VueJS, or perhaps Angular.

Vaadin supports the latest version of Java in a timely manner [2]. I acknowledge that the Vaadin company is rather slow to adopt newer Java standards. It took them years to acknowledge the Jakarta renaming scheme footnot:[The renaming was necessary because Oracle screwed up. The delaying of Vaadin means you cannot use the latest version of Jetty or similar frameworks].


1. It is a modern user interface framework and uses Modern Java as a programming language. It easily superseeds old 4GL approaches such as dBase, Clipper, FileMaker, Visual Fox Pro, PowerBuilder, Borland Paradox, 4th Dimension, or Oracle Forms.
2. The same can be said for the Gradle Build Tool since it supports toolchains configuration.