ROCA: Resource-oriented Client Architecture – an alternative to SPAs
roca-style.org
roca-style.org
As a general rule of thumb I find SPAs deliver much faster, but ROCA-style solutions are much more predictable. That is, getting a modest MVP out the door with an SPA terms to be much faster, but almost always reach a critical mass of functionality at which point they become hard to maintain. ROCA-style apps don't suffer with this as much.
I don't think this experience is just down to the architecture however. I just think it asks a lot more of a software engineer to structure and maintain an SPA well. Ultimately an SPA can be a more optimal architecture for many applications because the client-side environment is an increasingly powerful VM in its own right. However, I rarely see the engineering discipline required to do it right.
I tend to prefer ROCA-style because it fits better with the web's distributed integration architecture, but in practice I find building an SPA with a resource-oriented mindset is usually a good compromise.
So long as websites pretend they are documents, they will remain bloated poorly performing synchronous applications.
Accept that websites are distributed applications and deliver great experiences.
So maybe the user experience hierarchy goes something like: great SPA > MPA > average SPA?
This would mean there’s still a place for MPAs, at least with certain budget constraints.
So what? Get experience. The days of a plucky developer throwing together some simple page he built over a weekend while reading a programming book and having that be good enough for millions of people around the world are over.
Users will require richer and deeper experiences and that will breed a demand for some developers who actually know what they are doing, and possess a vast experience to draw insights from.
I disagree.
Most websites (99%) are just barely interactive documents with buttons.
The bloat we suffer today is because we ship them and design them as full interactive App when it's absolutely not needed.
Why this happened ? Because the current tooling make it easy. Not because it is the right design.
The "distributed application" is just a bullshit fashion of a time. very little applications require the current level of complexity compares to the features they give.
They are like they are because "create-react-app" and "npm install world" is easy.
Currently the web doesn't work without JavaScript, which I find very alarming.
Another library worth checking out if you're interested in this type of site is intercooler.js (https://intercoolerjs.org/). It's all about using minimal DHTML/AJAX to use server rendered partials.
No application-land javascript code, just HTML-extending attributes that fill out the functionality missing in vanilla HTML.
There's a set of interactions for which this works incredibly well and a set where it falls short.
If your UX and data model support the notion of users interacting with a single resource at a time it's really effective. If you have lots of data that has effects on other data you might be displaying, or you need lots of fine grained interactions, a full client side app will probably provide the best experience.
1. Why cater to this preference - you must ultimately force the consumer to do certain things to consume your data. Where do you stop? If some prefer the data in excel97 should you cater to that as well?
2. Do you want to have the liability of the possibility of the format’s data not being fully synchronized? Serve it one way and it will not happen.
Would something like this be better?
"Authenticated communication via a browser relies form-based authentication, possibly in conjunction with cookies. If cookies are used, they should include all of the state needed for the server to process them. All other forms of authenticated communication should rely on HTTP Basic or Digest Authentication, typically combined with SSL, possibly with client certificates."
Unless HTTP Basic / Digest are also unsuited for public API's in which case should they not be removed and some other recommendation be made?