5 ms·
Manipulating the DOM is not irrelevant in the sense that pretty much the only way HATEOAS could be useful is in generating a user interface that an intelligent
by gridlockd 6y ago
Manipulating the DOM is not irrelevant in the sense that pretty much the only way HATEOAS could be useful is in generating a user interface that an intelligent agent could navigate.
Only an intelligent agent could meaningfully navigate from one state to another, which is roughly equivalent to a clicking on URLs on static sites, which is how most websites work or at least used to work.
When you manipulate the DOM to implement interaction without any "hypermedia links", there is an impedance mismatch here and HATEOAS is not a good choice for user interfaces anymore.
> HATEOAS is capabilities discovery. HATEOAS is API versioning without explicit versions. HATEOAS is a documented and discoverable API. That's it.
You can't discover capabilities without prior knowledge unless you are an intelligent agent. That's why HATEOAS is a really bad choice for APIs. You effectively have to implement the agent "discovering" what you expect to be there, instead of just explicitly asking for what you need. It's not just pointless, it's a waste of time.
- cryptonector 6y agoExactly. Thank you for putting it so well.
- rumanator 6y ago> Manipulating the DOM is not irrelevant in the sense that pretty much the only way HATEOAS could be useful is in generating a user interface that an intelligent agent could navigate. That's patently wrong, and ignores basic RESTful standards such as HAL. The DOM is irrelevant and meaningless in the context of HATEOAS. There is no DOM at all. There is a resource, and the resource is tagged with link relations. That's it. Just because the word Hypermedia" pops out this does not mean HATEOAD has anything to do with HTML. > Only an intelligent agent could meaningfully navigate from one state to another, which is roughly equivalent to a clicking on URLs on static sites, which is how most websites work or at least used to work. This is where you're objectively showing where you're getting it wrong. REST I'd about resources and resources representations. Your "URL" is just a specific resource, and that resource is tagged with link relations which point to to other resources. It's the resource that is linked, not the content of the resource. > When you manipulate the DOM to implement interaction without any "hypermedia links", Again, you're showing where you've been getting it wrong. You do not manipulate any DOM to "implement interactions". You just get the link relations of a resource. That is all. Some HATEOAS formats even pass link relations through HTTP headers. The concept of a DOM is entirely meaningless in REST. There are only resources, resource representations, and link relations. That's it. Again, just because HATEOAS has "hypermedia" in its name that does not mean it has anything to do with HTML.
- cryptonector 6y agoThe way you debate won't make you friends. When you attack the way you do, the other side just discounts what you have to say. There's a better way to do this. > This is where you're objectively showing where you're getting it wrong. [...] The text I elided in that quote says nothing about how GP is wrong. Saying "objectively" doesn't make it so. You have to back up your arguments. In a way you're quite right: links don't have to be URIs, hypermedia doesn't have to be HTML, and links don't even have to appear in the media when you can construct them algorithmically (in the last case you can argue that even though they are absent in the media, they are notionally still there). However, GP is right that only an intelligent agent will be able to use useful things with links of types they don't already have baked in logic for doing things with, and this is really the key problem with HATEOAS: it's too human-centered, and implicitly so. Anyways, be kind.
- gridlockd 6y ago> That's patently wrong, and ignores basic RESTful standards such as HAL. That's an opinion on the usefulness of HATEOAS. I'm well aware that misguided developers keep inserting HATEAOS where it provides no value. It's just annoying. Realistically, the only useful thing you could do with HATEOAS-style data and an agnostic client is to generate a (rather crappy) UI for an intelligent agent to navigate. This is clearly what Roy Fielding had in mind as well, where I quote from his dissertation: "The name “Representational State Transfer” is intended to evoke an image of how a well-designed Web application behaves: a network of web pages (a virtual state-machine), where the user progresses through the application by selecting links (state transitions), resulting in the next page (representing the next state of the application) being transferred to the user and rendered for their use." > Just because the word Hypermedia" pops out this does not mean HATEOAD has anything to do with HTML. It may in principle be not specifically tied to XML or JSON or HTML or web browsers, however in practice that's the only domain where it is actually used. Therefore, alternative ways of doing things in that domain are relevant when talking about REST. > You do not manipulate any DOM to "implement interactions". Here I'm talking about how many modern web applications actually work, not how REST works.