Friday, September 28, 2012

The SPA as Horseless Carriage

Lately I’ve been talking a lot about rich client applications written in HTML and JavaScript. These are frequently referred to as “SPAs” (Single Page Applications). I call them SPAs myself – it’s cute and flows easily off the tongue.

Unfortunately the phrase “single page application” badly misrepresents the true nature of this architectural style. It reminds Jeremy Ashkenaz of the “horseless carriage”. Both notions capture a small truth while overlooking the larger significance of the technologies involved. No one in the 21st century describes the automobile as a vehicle without a horse. Someday we won’t describe a JavaScript client application as an “app hosted in a single web page.” 

What really matters is that the client application resides and executes on the client in the same way that desktop applications do. In every important respect these are desktop apps; they just happen to be written in HTML and JavaScript.

The single page host is a mere artifact, the app’s least interesting characteristic.What matters is the rich, responsive, productive user experience made possible by execution on the client, state on the client, and dynamic composition of the UI on the client. These apps go to the server only for resources and services that they cannot obtain locally. They communicate with the server mostly to get the latest data and to store user changes.They are otherwise self-reliant and (if designed for it) can function without a server connection for extended periods. This is what distinguishes them from the now-traditional thin client model that is the web form or MVC application – the carriage drawn by a horse.

The carriage has become something  else, a new form of locomotion. The UI has become something else, a new form of web application. The transformation is so sudden and disorienting that we cling to the thing that is lost: the horse, the web page.Eventually we will regain our balance and take for granted what seems novel today. We will find betters words to describe what this is.

Until then, I’ll call them SPAs, however quaint that will seem in a few years time.