Live data from Hacker News

ROCA: Resource-oriented Client Architecture – an alternative to SPAs

roca-style.org

11–20 of 25 posts

Re: ROCA: Resource-oriented Client Architecture – an alternative to SPAs

#11
post #2

Reading through the site feels like a breath of fresh air in today's convoluted web development. This is how it should have been right from the beginning.

This _is_ how it was for quite a while. Check out Rails as of about Rails3 or so. Unobtrusive JS, serving up partial HTML, etc.

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.

Re: ROCA: Resource-oriented Client Architecture – an alternative to SPAs

#12
post #5

I don’t think a server should serve the same content in xml and json. 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…

I’ve had this discussion as well, and I fully agree. In my experience, this kind of thing exists purely to sneak in the more programmer friendly JSON in corporate environments that have otherwise “standardized on XML”. You wouldn’t get away with pure JSON, but you can argue for a hybrid approach.

Re: ROCA: Resource-oriented Client Architecture – an alternative to SPAs

#13
post #8

This seems a very nostalgic take. 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.

I agree with you. However, making a great single-page app takes a lot of experience and work, a bit less so with current frameworks, but still. A lot of in-house SPAs are truly terrible, with bad performance and broken navigation, you wish the developers wouldn’t have bothered. Multi-page apps might be a bit harder to screw up as badly.

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.

Re: ROCA: Resource-oriented Client Architecture – an alternative to SPAs

#14
I love to see this, and of course the early shoutout for pjax.

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.

Re: ROCA: Resource-oriented Client Architecture – an alternative to SPAs

#15
post #13
post #8

This seems a very nostalgic take. 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.

I agree with you. However, making a great single-page app takes a lot of experience and work, a bit less so with current frameworks, but still. A lot of in-house SPAs are truly terrible, with bad performance and broken navigation, you wish the developers wouldn’t have bothered. Multi-page apps might be a bit harder to screw up as badly. So maybe the user experience hierarchy goes something like: great SPA > MPA > ave…

> “However, making a great single-page app takes a lot of experience and work, a bit less so with current frameworks, but still.”

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.

Re: ROCA: Resource-oriented Client Architecture – an alternative to SPAs

#16
post #5

I don’t think a server should serve the same content in xml and json. 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…

[deleted]

Re: ROCA: Resource-oriented Client Architecture – an alternative to SPAs

#17
As a UI architect I've worked on both SPAs and also ROCA-style UI quite a bit. Like everything pros and cons to both.

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.

Re: ROCA: Resource-oriented Client Architecture – an alternative to SPAs

#18
post #8

This seems a very nostalgic take. 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 long as websites pretend they are documents, they will remain bloated poorly performing synchronous applications.

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.

Re: ROCA: Resource-oriented Client Architecture – an alternative to SPAs

#19
post #8

This seems a very nostalgic take. 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.

It depends what the app is, surely? The problem is too many things that should just be displaying a single document instead produce a bloated SPA with worse usability. Medium is probably the archetype of this.

Re: ROCA: Resource-oriented Client Architecture – an alternative to SPAs

#20
post #8

This seems a very nostalgic take. 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.

And I think all apps and websites should work like that.

Currently the web doesn't work without JavaScript, which I find very alarming.

Post reply on HN