Declarative GUI

In this section we consider approaches to GUI design in a more declarative way.

One fundamental problem with traditional "imperative" GUI programming is the disconnect between intentions and the implementation. For instance, when observing the data model, a block of code does not necessarily reflect the structure of the user interface. Deriving this structure statically from the code can be difficult. However, Java and other GUI frameworks often provide means for runtime introspection of the UI. As a result, while runtime visualization of the GUI's structure is realizable, the lack of structure may complicate e.g. bidirectional round-trip engineering / modelling of the GUI using graphical tools.

Mapping of the UI behavior to events and handlers also introduces a set of new problems. For instance, consider a new event triggering the associated handler. From a code analyzer's point of view, the body of the event handler is a black box. It requires additional effort to deduce the effects of the handler without actually executing the handler at runtime. A different kind of encoding of value propagation could enable better tracing of the effects.

Lecture slides

Video: Lecture video
lecture slides

Course book

  • Chapters 1 & 2