Vaadin flow withouth spring

Hi, i have been using vaadin since v7 then short migration to 8 and an revrite of the app to vaadin flow 14. Now we are on v25 and the whole time we work without spring.

How many developers are out there working on pure java and flow without spring and do you think is it wise to create an enterprise grade app this way. We chose this path deliberatly after several months of investigating the pros and cons. That was 10 years a go. Does this still apply? We are a small team of 3-5 people, depending on the project.

I am very curious about what you think and how many of us are there :)

I personally doubt that there are a lot of people not using spring (boot) these days. Just a guess 80% boot, 10% plain / jakarta and 10% quarkus - at least in the Vaadinverse.

It might be worth to reinvestigate the pros and cons of 10 years ago. Even tho I’ve got the feeling that after 10 years developing without DI… you probably have created your own in-house framework to leverage some of spring’s perks without using it.

We switched all our projects over the last 4-8 years to Spring Boot - and won’t look back. It’s fits our small teams so much better. Coming from Plain, Guice, OSGI or Porlets…

2 Likes

FWIW… we’ve been using Vaadin since 2012. We use Spring a lot, but not Spring Boot, which didn’t exist back when we started. We also still use Spring XML files for DI (instead of annotations) and have a web.xml.

I’ve run into occasional problems where Vaadin is assuming that “everybody uses Spring Boot”. Spring itself is very well designed and properly layered, yet sometimes Vaadin conflates those layers a bit.

For example: Issue · GitHub , where I was (somewhat jokingly) told:

To paraphrase Tolstoy: All Spring Boot apps are alike; each Spring app without Spring Boot is broken in its own way. Focusing on Spring Boot helps us get 80% of the benefits for 20% of the effort.

On the way from migrating from v8 to v14 to v23, we start using Spring Boot since v23. We have 2-4 people on this project.
For me it improved DX a lot and also I felt better using built-in spring tools rather than building it from scratch, like scheduling.
On technical side we had to change little things (at build time) but nothing didn’t work at the end.
Also we are using our own authentication logic instead of spring.

On other projects, I use jar deployment instead of war, which makes it easier to encapsulate these projects in docker.

Our project is 25+ years old and is currently a JavaEE ear with several war entrypoints, many of which are Vaadin applications.

As someone else said; It has been somewhat challenging to fight against the “but everyone uses Spring Boot” mentality from Vaadin, so I have looked into porting several times. I have so far decided against it, but I have a feeling it might be inevitable.

I don’t think it’s inevitable. I’m using Spring boot mostly for the backend/service layer and for security.

If you’re not using Spring boot then you need to replace that part.

In a Vaadin view, I’m injecting the service but it’s not Spring specific. It doesn’t change the way the view is built. The views I’m building are “Spring” bean but very often prototype scoped which works well without Spring. I tend to not create Vaadin components/ dialog as Spring bean.

In my opinion, the code specific to Spring boot in Vaadin is really small.

If you prefer " framework-less" approach , you should definitely check here: GitHub - mvysny/vaadin-boot: Boots your Vaadin app in embedded Jetty from your main() method quickly and easily · GitHub
And read the blog post.

My comment about fighting against Vaadin has to do with our history of having a multi-module project served as one ear, with several vaadin wars with one shared widgetset, and Vaadin’s devTools belief that there is only one source directory.

So, not directly related to spring boot as such, but when we discussed our issues with Vaadin several years ago, porting to spring boot came up as a suggestion.

In the end I worked around that particular problem by not using the devTools. :slight_smile:

So, we run fine without Spring Boot for now.
But, there is still a pressure from within to use Spring Boot, because reasons.

1 Like