Differences between GWT and Vaadin

GwtVaadin

Gwt Problem Overview


Can anyone suggest whether "GWT" or "Vaadin" are a better choice to design an application? Also: what are the differences in coding style?

Gwt Solutions


Solution 1 - Gwt

In GWT application logic is normally run on client side. It only calls server when it needs to read/save some data.

In Vaadin application logic is on server side. Client side must normally call server after every user interaction.

GWT advantage:
App logic (replies to user interaction) is faster as it is run locally in the browser. It's also relatively insensitive to bad network conditions. Network is used only when needed (to read/save new data), which saves net traffic (important for high traffic sites).

In this regard Vaadin is slower and introduces a lag in UI interaction which is annoying to user. If network is bad this will show in UI responsiveness.

Vaadin advantage:
App logic is run on the server so it can not be inspected by the user. Arguably (Vaadin claims) that makes it more secure.

Solution 2 - Gwt

A few more points:

  • A fundamental difference is that in GWT you have to separate your application into Client and Server code, no such distinction in Vaadin. This will affect the architecture of your application.

  • In GWT client code, you must code in Java, and have a limited subset of language features available (that the GWT compiler can translate into Javascript). In Vaadin, you can code in any JVM language, since everything runs in the server (I'm using Vaadin with Scala). This may or may not be relevant to you.

  • GWT compilation is VERY slow, although in development mode you have the emulator. This makes production environment updates painful (a GWT application I developed has grown pretty big, and currently takes around 15 minutes to compile).

  • It's very simple to extend GWT with 3rd party widgets, or roll your own. Creating new Vaadin widgets is more complex.

Solution 3 - Gwt

Another Vaadin advantage: you don't have to design or implement the client-server communication, that's built-in.

Solution 4 - Gwt

With Vaadin you can also use built-in GWT when you want to do something on the client-side. This gives you both simplicity of server-side programming model (no communications, no browser programming needed) with being full control of what happens in the browser.

Solution 5 - Gwt

Differences between Vaadin and GWT:

A) Vaadin includes a server-side development model that:

  • Cuts number of code lines to half by reducing layers one has to implement for user interface.
  • Allows you to use any JVM based language for user interface - Scala, Groovy
  • Increases security by keeping user interface logic in the server
  • Allows synchronous calls to any backend API from the web server
  • Allows use of any standard Java libraries and tools for UI layer- in server side architecture applications
  • Does not need Java to JavaScript compilation step that often takes time or makes tooling complicated in GWT projects - instead you have the Vaadin client engine
  • Provides server push out of the box with no extra code needed

B) Vaadin provides a large set of high level user interface components. For GWT one would need to use commercial Sencha GXT for comparable component set.

C) Vaadin includes SASS based Valo theme engine that makes it easy to build good looking custom themes from your application. Valo is the latest theming for Vaadin.

D) Data binding: Vaadin has incorporated the ability to associate any widget directly to a data source such as database, file or anything else in the server-side. This enables to define default behavior of the widgets to act on data sources.

Vaadin vs GWT

Solution 6 - Gwt

I haven't tried Vaadin. I'm a GWT fan, but I CAN say that I've been a bit disappointed by the default widget set provided with GWT. You really need something like http://www.smartclient.com/smartgwt/index.jsp">SmartGWT</a> to fill the framework out.

Solution 7 - Gwt

tl;dr

>whether "GWT" or "Vaadin" are a better choice to design an application

It is not an “either-or” question.

With Vaadin, you get GWT (or its counterpart, Web Components) plus much more.


Vaadin is a framework for building desktop-style web apps by writing pure Java code on the server-side including declaring a user-interface. That user-interface is rendered in a web browser by Vaadin automatically generating on-the-fly the necessary browser code: HTML, CSS, JavaScript, etc. Business logic executes only on the server-side. User events (buttons clicked, data typed into fields, etc.) on the web client trigger Java code to run on the server side.

How that browser code is generated and executed, and how the client and server communicate, depends on 3rd party technology:

  • In Vaadin 8 and earlier, GWT
  • In Vaadin 10 and later, Web Components

Vaadin 8 and earlier uses GWT

Vaadin 8 and earlier was built on top of Google Web Toolkit (GWT). GWT has been spun-out of Google, as a fully open-sourced project: http://www.GWTProject.org/

GWT cross-compiles Java code into standalone JavaScript files. GWT provides other important features such as support of UI components and client-server communications.

The Vaadin Ltd company is a major supporter of GWT, including having hosted GWT developer conferences, and providing consulting expertise services.

Vaadin is only one of many products built on GWT.

Vaadin 10 and later uses Web Components

Vaadin 10 and later, known as Vaadin Flow, is a major rewrite of the framework. Instead of using GWT underneath, Vaadin Flow is built on top of Web Components technology.

Web Components is actually a suite of technologies including Custom Elements, Shadow DOM, and HTML Templates. These technologies are now built into most every modern web browser, and supported on many older browsers via polyfills.

Writing a new widget component for Vaadin is much easier with Web Components than with GWT. And most any existing Web Components based component can be wrapped to provide access via Java from the Vaadin server-side framework.

I don't have a source at hand to cite, but as I recall, Web Components based widgets may run faster and use less memory than their GWT-based equivalents.


By the way, both generations of Vaadin depend on some other technology, such as the Atmosphere library for help with WebSocket and HTTP.

Solution 8 - Gwt

I belive Vaadin is a much more advanced framework than GWT BUT When it comes to optimise performance on the client side there is nothing much you can do unless you build your own components (and that's where the beauty of Vaadin stops) In a project i'm working right now 90% of the staff I've done worked as a charm And then I had to use an event timeline next to a couple of tables. When I loaded more than 400events on the timeline my web page was almost unusable not to mention terrible slow on initialisation. I've been trying to optimise the code the last two months. At the end I used a GWT component.

Solution 9 - Gwt

As any application has to show display information coming from the server, a major requirement for simple coding is automated data binding to your forms and tables. With Vaadin, this is as simple as a few lines of code. In GWT, first you have no table mapping. As for forms, you can map an object to a form, but to do so you have to implement a so called GWT Editor for your object (and one for every object inside of it). An Editor is nothing else than the definition of the form to use to show/modify the object. So all in all, there is no automation here.

Solution 10 - Gwt

GWT enables you to write web-clients with Java. The GWT cross-compiler creates JavaScript code for the client-side. You have to care for the server for your own as well as client-server communication. The generated client-code is already optimized for many browsers. My personal opinion is, GWT was very popular until Google focused on Angular. Today it is not much popular anymore.

Vaadin provides two different solutions:

  1. a UI widget-set based implementing the web-component standard, and
  2. the Vaadin serverside Java framework. It allows you to write web-clients with Java. However, Vaadin generates the web-client through runtime on the server dynamically. Vaadin cares for the entire client-server communication. For rendering the UI, Vaadin until version 8 used a pre-compiled UI widget-set. Vaadin from version 10 uses the Vaadin web-components.

Further benefits of Vaadin:

  • You do not get in contact with HTML and JavaScript and you need not bother for DOM manipulation, browser history and other low-level problems
  • The serverside architecture provides better security
  • Modern themes
  • Individual styling with CSS
  • RapidClipse provides a powerful UI builder for Vaadin based on Eclipse containing a Vaadin <> JPA databinding, internationalization, UI persistence, extended Hibernate tools, JPA-SQL query language and MicroStream integration for creating Java in-memory database apps and microservices

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionsundharView Question on Stackoverflow
Solution 1 - GwtPeter KnegoView Answer on Stackoverflow
Solution 2 - GwthbatistaView Answer on Stackoverflow
Solution 3 - GwtJouniView Answer on Stackoverflow
Solution 4 - GwtJoonasView Answer on Stackoverflow
Solution 5 - GwtJoby Wilson MathewsView Answer on Stackoverflow
Solution 6 - GwtCurtisView Answer on Stackoverflow
Solution 7 - GwtBasil BourqueView Answer on Stackoverflow
Solution 8 - GwtDr.HalvidView Answer on Stackoverflow
Solution 9 - Gwtuser1469130View Answer on Stackoverflow
Solution 10 - Gwtuser12537721View Answer on Stackoverflow