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.


Ryan said...

I totally agree on the terms you discuss. You should come up with the "car" word that we'll all use in a decade.

One question I have: aren't SPAs also something more and less than desktop applications? They have limited access (at least for now) to the underlying hardware; yet they are also delivered with the latest updates (no install needed) each time you access the application. They are also delivered along with the initial application data (in many cases). These things all require a slightly different approach than "desktop" applications.

I'm curious as to your thoughts.

Ward Bell said...

@Ryan I agree that there tend to be differences. Whether they are significant depends upon your point of view and the particulars of your application.

For example, you can enable access to mobile hardware with PhoneGap; it's still a SPA (HTML/JavaScript) application when you're done.

And if you were/are a Silverlight guy like I am/was, updating the client application was as effortless as for a SPA.

If anything stands out for me, it is how painful, slow, and error prone SPA development is compared to Silverlight development. The DOM and x-browser issues are productivity killers. And there's no escaping the enormous quality advantage of a compiler that catches my stupid implied-type mistakes.

TypeScript is the great news on that last score.

Joe Kowalski said...

You had to say Silverlight. We are just completing our REST API and I'm excited to release our next version of our mobile product that will use it/jQuery/json. But it's bitter sweet knowing that we are still going to have to use very subjective and finicky html for the client design. Not to mention loosing the stability and security of the great DevForce engine.

I haven't dusted off Morphous (my Silverlight MEF view/dynamic grid projection UI framework I demoed for you and John P) in nearly a year.

I've finally come to terms with it though. :-)

Oh, and I think the laymen term you're looking for is, app.

Hope your well.