Why I think AJAX breaks REST continued

There were some really good comments on my “Why I think AJAX breaks REST” post to which I tried to reply. The reason for this new post was Andrew Newman‘s comments.

I disagree with Andrew on his assertion that REST is only about how services should be exposed. I think that REST is an architectural style on how to write distributed applications, not just services. It sets the principles of RESTful applications and defines the interaction constraints that should be applied in order to maintain those principles. This is the first sentence of Roy Fielding’s chapter 5:

“This chapter introduces and elaborates the Representational State Transfer (REST) architectural style for distributed hypermedia systems, describing the software engineering principles guiding REST and the interaction constraints chosen to retain those principles, while contrasting them to the constraints of other architectural styles”

Please also note that REST is an architectural style for a hypermedia application. In a hypermedia application, when one follows a link the result is a transfer to a different state. Also note that one of the constraints is that state is identified by URIs.

I do agree that AJAX is a way to write client-side code. I don’t think I supported otherwise.

What I did say is that the use of the AJAX approach to building distributed applications, or even just client-side ones, encourages a move away from the REST principles and that those building distributed applications should be aware of that. Of course, if any approach (REST or non-REST) results in well-architected, good, scalable solutions offering high-value then I don’t see why we shouldn’t use it. We just can’t call all the good things out there RESTful.

Recent Posts

Digital Twin (my playground)

I am embarking on a side project that involves memory and multimodal understanding for an…

2 months ago

“This is exactly what LLMs are made for”

I was in Toronto, Canada. I'm on the flight back home now. The trip was…

9 months ago

AI is enhancing me

AI as an enhancer of human abilities.

10 months ago

“How we fell out of love with voice assistants”

The BBC article "How we fell out of love with voice assistants" by Katherine Latham…

1 year ago

Ontology-based reasoning with ChatGPT’s help

Like so many others out there, I played a bit with ChatGPT. I noticed examples…

1 year ago

Break from work

Hi all… It’s been a while since I posted on this blog. It’s been an…

2 years ago