16 ms·
> A programmatic client can't do that without in someway hard coding the structure of the API. That's false. Here is the HTML again, augmented with a link rela
by bmn__ 4y ago
> A programmatic client can't do that without in someway hard coding the structure of the API.
That's false. Here is the HTML again, augmented with a link relation which by its nature is perfectly understandable to a program.
<a href="/accounts/12345/deposits" rel="https://schema.org/DepositAccount">deposits</a>
Anyone can coin a link relation on the Web, as long as its identifier is a URI. Tokens are reserved and need to be registered at IANA: https://www.iana.org/assignments/link-relations https://www.iana.org/assignments/link-relations
- treis 4y agoIt's understandable if you write the code for the program to understand. If it changes from deposits to credits tomorrow then your program breaks. Hence it's coupled to the server.
- bmn__ 4y agoThere is always coupling. The question is whether a certain architectural design is coupled loosely or tightly. If you read Fielding's blog post referenced in TFA, you can see he is an advocate of loose coupling. I have demonstrated this design in my post above.