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

BrainExpanded – Login State Caching Issue in iOS Share Extension

As part of the BrainExpanded project, I’m building an iOS app that lets users easily…

2 weeks ago

Is AI Good or Bad?

Artificial Intelligence (AI) has rapidly evolved over the past few decades, becoming an integral part…

2 weeks ago

BrainExpanded – Copilot

Happy New Year everyone! I was planning for my next BrainExpanded post to be a…

2 months ago

BrainExpanded – The Timeline

See "BrainExpanded - Introduction" for context on this post. Notes and links Over the years,…

2 months ago

BrainExpanded – Introduction

This is the first post, in what I think is going to be a series,…

2 months ago

Digital twin follow up

Back in February, I shared the results of some initial experimentation with a digital twin.…

3 months ago