Overview of Vaadin

The mission of Vaadin Ltd (the company that maintains Vaadin) is “developer productivity, end user experience, and scalability.” With Vaadin, you build web applications by writing Java code that runs on the server.

You don’t need to know any languages other than Java to build web applications.

Vaadin is open source, licensed under the Apache 2.0 license, which means you can download it, change it, and redistribute it to your heart’s content.

Now, let’s look at each of those in more detail.

Vaadin’s goals

…to be the best possible tool when it comes to creating web user interfaces for business applications. It is easy to adopt, as it is designed to support both entry-level and advanced programmers, as well as usability experts and graphic designers.

And I’ve used Vaadin since 2012, and I can tell you, they deliver on this goal.

Though in all fairness, I have to say, heed the following warning: to use more than the most basic Vaadin features, you really need to understand how Vaadin does things. If you do, it will pay dividends, I assure you. If you don’t, you will bang your head in frustration (I also, speak from experience).

But don’t worry. Vaadin has lots of documentation to tell you everything you need to know about Vaadin (and great community support if you get stuck). More on that later.

Server-side architecture

Vaadin’s architecture uses JavaScript in the browser to communicate with your components on the server. It is built on Google Web Toolkit, but unlike a GWT application, Vaadin includes pre-built widgets that you use to construct your UI. Rather than writing your components in Java, which are then compiled into JavaScript by the GWT compiler, you simply use Vaadin classes to build the UI in Java code. At runtime, communication between your server-side Java code and the JavaScript running in the browser is handled automatically.

However, if the plethora of out-of-the-box components provided by Vaadin don’t meet your needs, Vaadin lets you create client-side widgets, which are compiled by the Vaadin Client Compiler (which is based on the GWT compiler) into JavaScript. You then write Java code to use the custom client component in your UI just like you would any other Vaadin UI component.

Pure Java

Vaadin is 100% Java. No JavaScript (or any other language for that matter) required.

Even if you decide to create your own client-side widgets, you still write Java code for them (just like with GWT), which the Vaadin client compiler turns into JavaScript to run in the browser.

A brief history of Vaadin

The framework went through several iterations, and in 2009 the name was changed to Vaadin, and version 6 was released.

The word Vaadin is Finnish for doe (female reindeer). Look carefully, and the Vaadin icon }> on its side resembles a reindeer (go on, try it).

How to use Vaadin

Like I said, I have used Vaadin since 2012, and I believe it is super easy to get started using it. You just need Maven and a Java compiler. Make it easy on yourself though, and bring an IDE to the party.

Though you don’t really need an IDE, it does make your life easier, since there is a probably a Vaadin plugin for your IDE.

Then you fire up the New Project wizard, go through it, and start writing code.

IDE plugin

The easiest way to get started is by using an IDE like Eclipse or NetBeans, and there are free plugins for both. If you have IntelliJ Ultimate, then Vaadin has a plugin for that too.

I use Eclipse as my IDE so I’ll describe getting started with Vaadin using the Eclipse plugin, but the general steps are pretty much the same for any IDE (under the covers they all create a Maven project).

New project wizard

When the wizard finishes, you have a Maven project skeleton that includes everything you need to get started building your new web application project.

Writing code

Now you write code using the generated UI subclass, and you’re on your way. Next add Buttons, Drop-down selects, Text fields, and so on, until your application looks and functions the way you want it to.

Did I mention you only have to write code in Java? Thought so.

Check out the Vaadin sampler for a look at the collection of widgets Vaadin provides right out-of-the-box, along with sample code that shows you how to use them.

The Vaadin website

Support

The Vaadin community, in addition to a searchable post archive, lets you (once you register) ask questions if you run into trouble.

Whenever I posted a message, I never failed to receive a reply from Vaadin staff to my question with 24 hours, and 3/4 times it was from a project committer. How cool is that?

Conclusion

If you want to write web UIs, you have lots of choices. But if you want to write web applications that include a rich client UI, and a server-side, pure 100% Java model, I recommend you look at Vaadin.

Share this:

Steve Perry has been a professional software developer since 1991 using a variety of languages, but his favorite is Java. He is the author of Java Management Extensions (O'Reilly), Log4j Shortcut (O'Reilly) and has moderated the developerWorks Java Enterprise Open Source Application Architecture community. He has been a developerWorks contributor since 2009.
Steve is Principal Consultant for Makoto Consulting Group, Inc. in Little Rock, AR, USA.
When he isn't playing hockey or practicing yoga, Steve likes to make educational videos and post them on YouTube for Makoto TV. Check it out here and please subscribe!