Skip to content
Paul Bennett edited this page Nov 12, 2016 · 7 revisions

The Problem

Vaadin has a number of advantages over more traditional Javascript based frameworks, especially for business applications, but constructing an interface generally requires a lot of code - lots of .setXXX calls, temporaries to hold various sub-parts before they can be added to containers, along with more setter calls. This obscures the essence of the interface, making the code hard to read, understand and maintain.

It also requires that the UI be event driven. In a simple interface, this is not so much of a problem, but as it grows, and multiple UIs become involved, the usual problems of event storms, unexpected behavior and difficulty of debugging raise their ugly heads.

Functional Vaadin is intended to solve these two problems

A Solution

I've looked to two fairly well known techniques to solve these two issues: a homoiconic DSL for definition of the UI structure, and an FRP/Reactive solution for defining the behavior. The intention is that together, these two can be used to produce a definition of a complex UI which is easy to understand and reason about.

Clojure is an especially attractive language in which to implement this. Its own homoiconic property can be used to directly reflect the structure of a UI as a series of nested function/macro calls, and it's flexible polymorphic dispatch makes internal implementation much easier than Java or other OO based languages.

There are several FRP/reactive implementations for Java available, and I've used RxJava, via a Clojure interface library, rx.lan.clojure. There is another very interesting library called Sodium, (https://github.com/SodiumFRP/sodium) which is a true transactional FRP implementation. There is a minimal Clojure integration, but it is not particularly functional - in both senses. See another of my projects (https://github.com/wizardpb/sodium-clj) for a better way of using it from Clojure. (Note - this is definitely a work-in-progress)

Clone this wiki locally