In-depth explanation of how Vaadin works

Let’s say I have this code:

package com;

import com.vaadin.annotations.;
import com.vaadin.server.VaadinRequest;
import com.vaadin.ui.

@Title(“My UI”)
public class MyFirstVaadinApplication extends UI
private int buttonNumber = 0;

public void init(VaadinRequest request)
VerticalLayout layout = new VerticalLayout();
layout.addComponent(new Label(“Hello, Bogdansky!”));

// Have a clickable button
layout.addComponent(new Button("Push Me!",
                                new Button.ClickListener() {

                                  public void buttonClick(Button.ClickEvent e) {



protected Button createButton(final VerticalLayout layout)
return new Button(String.format(“Button %d”, ++buttonNumber), (Button.ClickListener) clickEvent → {
[/code]What exactly happens when I click on Button 1? I watched the net traffic and it seems to execute a server call. I attached two screenshots of the request that was sent upon clicking Button 1. The page seems to be sending some state of the client UI to the server requrest handler. I assume that some synchronization process happens on the server, where the state is restored in an instance of the MyFirstVaadinApplication class. Another interesting thing is that buttonNumber is incremented with each button click as if the same MyFirstVaadinApplication instance is used. Does the server keep around an instance of MyFirstVaadinApplication for each individual request (via a token), i.e. if I open a new tab, go to the page, the page gets a new token and a new instance of MyFirstVaadinApplication is associated with that token on the server side, and from that point on this instance is used to handle all the client requests from this particular page?

Could you please point me to an article that explains in-depth how Vaadin works exactly? It would be nice to see a sequence diagram as well.

Thank you

I guess you should start by checking out
Book of Vaadin
. At least chapter
should be interesting.