Skip to main content

What's so cool about Vaadin Flow?

·341 words·2 mins
Vaadin
Alejandro Duarte
Author
Alejandro Duarte
Alejandro Duarte is a Software Engineer, published author, and Developer Relations Engineer at MariaDB. He has been programming computers since the mid-90s. Starting with BASIC, Alejandro transitioned to C, C++, and Java during his academic years at the National University of Colombia. He relocated first to the UK and then to Finland to foster his involvement in the open-source industry. Alejandro is a recognized figure in Java and MariaDB circles.

Vaadin Flow is a free open-source web framework for Java developers. It allows you to implement a web application without having to code any JavaScript or HTML. See the following example:

@Route("")
public class MainView extends VerticalLayout {
    public MainView() {
        TextField textField = new TextField("Enter your name");
        Button button = new Button("Click me", event ->
                add(new Label("Hello from the server, " + textField.getValue())));
        add(textField, button);
    }
}

​If you deploy this to a Java server, you’ll get the following:

Vaadin Hello World example

Since the UI code runs on the server side, you can debug it using the tools that your Java IDE of your choice provides. For example, here we are adding a breakpoint in the line that gets invoked when the button is clicked:

Breakpoint in Vaadin

These are some of the cool things about Vaadin Flow:

  • You can use one single programming language to implement a web application (Java or any other for the JVM).
  • ​You can “connect” Java business logic easily–just call the Java method, no need to implement REST web services and parse JSON.
  • You can “forget” about certain security issues. For example, if a button is disabled and a malicious user enabled it with for example Chrome DevTools in the browser and clicked it, the framework wouldn’t call the server-side listener anyway–if a button is disabled, you can rest assured the server logic won’t be invoked.
  • Flat learning curve. Since the programming model is closer to desktop development, developers can start maintaining applications easily.
  • Vaadin Flow includes many ready-to-use components such as ComboBox, DatePicker, Grid, Dialog, Checkbox, ProgressBar, Notification, Tabs, and many others.
  • You can create your own UI components by using object-oriented composition, HTML, and JavaScript.
  • It makes it easy to integrate existing Web Components. So, if you find or develop a useful Web Component, you can wrap it in a server-side Java class.
  • You can manipulate the DOM from the server side. You have full access to the underlying DOM in the browser form the server.

This is not it. There are many additional cool features in Vaadin Flow!

Enjoyed this post? I can help your team implement similar solutions—contact me to learn more.

Related

New book about Vaadin 8: Data-Centric Applications with Vaadin 8
·266 words·2 mins
Vaadin News
My new book about Vaadin 8 is available now.
Microservices & Vaadin
·309 words·2 mins
Vaadin
Experiments with microservices and Vaadin applications.
New book about Vaadin Framework 8 coming out
·177 words·1 min
Vaadin News
Writing a new book about Vaadin Framework 8.