Vaadin Reaches Version 21 |
Written by Nikos Vaggalis | |||
Thursday, 16 September 2021 | |||
The versatile full stack Java-based framework that is a competitor to Spring MVC, continues to innovate with its new release of v21. But first, what exactly is Vaadin? Javascript for front-end development is not an all-or-nothing proposition any more; and not just Javascript. Developing for the web even at the most basic level requires knowledge in at least three Web standards; that of HTML, CSS and Javascript. I say "at least" since on top you can add things like WebSockets, Web Workers and the rest, with the stack continuing to grow. The issue is more prevalent in an Enterprise setting where you've got a pool of Java dinosaurs, err developers, who are great at defining the business logic and building solid applications, but when it comes to the Web and the front-end they lose their sleep over. This is also depicted in Vaadin's adoption - of 4% according to Snyk's JVM Ecosystem Report 2021 and only 2% according to Jetbrain's State of Java report 2021. But that 2 to 4% represents the 40% of the Fortune 500. Companies known to use Vaadin today include: Disney, Wells Fargo, Bank of America, GlaxoSmithKline, Raytheon, JP Morgan Chase, Volkswagen America, Rockwell Automation, National Public Radio (NPR) and many more. As such, frameworks that hide this complexity and make use of a single language for writing both the back end and the front end have been on the rise. We've discovered .NET's side of the story in the article "Blazor WebAssembly Crash Course", where I found that Blazor is a way to write web applications both on the server and client side with .NET and C# instead of using Javascript on the front-end.Code in Blazor compiles to WebAssembly, not Javascript. The way it works is that a .Net runtime compiled to WebAssembly is downloaded into the user's browser which then runs the Blazor application in the same sandbox that JavaScript runs. And due to this magic of WASM, you can run high intensity apps, even C++ games, inside the browser! Java's counterpart, if taking Blazor out of the equation, is Vaadin. Vaadin, the Finnish word for 'Reindeer', allows writing the presentation layer in Java too, forgoing all the Javascript drama. Vaadin in its beginnings used GWT under the hood to compile the Java code to JavaScript. Not anymore.Since version 10 it compiles to Web Components and through its Client side JavaScript engine communicates the events taking place browser side to the server side which decides how to proceed, in for example modifying the DOM;that is Vaadin renders the application server side and this server side endeavor goes by the name of Vaadin Flow.Hold that thought for a moment because there's a reason for mentioning it. In any case you just don't have to think about Server side or Client side; you just go on developing in your favorite Java like you used to do and let the framework handle both sides of the equation. As said, Vaadin has just 4% adoption despite it's versatility. But then what is the alternative? Spring MVC, currently dominating the market, with a templating engine like Thymleaf + Jquery, Vue.js, etc. But going Spring MVC you'll have to master a steep learning curve that includes JavaScript. Vaadin in contrast offers out of the box customizable themes (collections of layouts for components) which can be switched without affecting the business logic:
In addition Vaadin requires less configuration than a Spring MVC project to start with. However they are not mutually exclusive, they can also work together. Check "Using Vaadin with Spring MVC" for more. Of course, both go together with Spring Boot. So is server side Flow the answer to all problems? Vaadin's latest versions have introduced yet another way of building the front-end, that of Fusion. In an attempt to lure developers that work say with Angular, Fusion allows to do your actual reactive UI logic in TypeScript while continuing writing the backend in Java. There's a nice Frontend framework comparison between
With all that background setting to provide the context out of the way, let's now concentrate on what release 21 brings:
The project's roadmap reveals that it is very much alive with a vibrant and supportive ecosystem around it. On that roadmap there's some interesting todos outstanding, but the one that merits attention is Stateless Fusion. Vaadin Flow uses server side sessions heavily and Fusion does the same. This change would mean that Fusion would not create or store information into server sessions, allowing easier horizontal scaling of instances and high availability of services. So given all the above it's up to you to decide whether setting Spring MVC aside, even for a brief moment, in order to give Vaadin a try is worth it. And to make that transition easier there's a brand new book out on Apress by Alejandro Duarte of the Vaadin team, Practical Vaadin: Developing Web Applications with Java.
More InformationRelated ArticlesThe Insider's Guide to the Java Web Developer Nanodegree - 2 Compile Spring Applications To Native Images With Spring Native Blazor WebAssembly Crash Course Kotlin Versus Java - A Developer's Rosetta Stone Understand Gradle In Half An Hour
To be informed about new articles on I Programmer, sign up for our weekly newsletter, subscribe to the RSS feed and follow us on Twitter, Facebook or Linkedin.
Comments
or email your comment to: comments@i-programmer.info |
|||
Last Updated ( Thursday, 16 September 2021 ) |