What's so cool about Vaadin Flow?

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:



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:



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.

There are more cool features in Vaadin Flow. The following videos show some of them in action:

Popular posts from this blog

Hello, World in Vaadin 10+

Learning Microservices with a Practical Example

Infinite lazy loading