Coder Social home page Coder Social logo

Comments (1)

hlgr360 avatar hlgr360 commented on June 18, 2024

Juan Martinez, Salvador @JuanS 10:45 AM
Oh nice, thats a lot of interesting material to read, I haven't read it all yet, but i will, in the meantime, related to some of the topics you mentioned above, my personal take on how to use hypermedia:

Without hypermedia, clients had to make requests, read the values of the response (state) and according to the values, then implement business logic to decide what to do next. With Hypermedia, if you offer state through links, with possible actions (like a finite-state-machine) then on the clients, one can just perform coding around the presence or absence of links.

So basically the target is to remove all the domain/business knowledge from the client side, and replace it with "protocol" knowledge through links. This way you remove duplicated implemented logic, effectively reducing the amount of changes that would have been breaking ones, achieve loose coupling, etc. But also, at the same time, need to carefully design hypermedia, because, the risks of making everything accessible through links can lead to a really chatty API, which at the end can do more harm than good. This is one of the reasons I also like consumer-driven-contracts approach, it makes those 2 concerns easier to address.
👍🏻 1

Reinhardt, Holger @reinhardth 10:51 AM
true ... and you went way deeper the rabbit hole than I would (which is a weird way of making a compliment) 😉
to me they are two ways of coupling I have observed .. there is syntactical coupling ... which usually involves interfaces directly or indirectly generated from an implementation .. you change the implementation, you change the interface
this was the original sinn of WebServices .. it was essentially a functional interface across the network ... you changed one side .. you had to change everyone relying on it too ... which did not scale for even mildly complex environments
then there is a more hidden kind of coupling ... I call it semantic coupling ... it is the embedding of knowledge about the API/interface in the client
a particuar way how URL's are constructed
hardcoding server IP's
some stuff you know becaue you have access to the server code etc
this coupling is non-obvious but it falls on your feet the moment you change something fundamental about the server .. maybe you move the server to a difference hostname or ip
or you change the urls
or you change a particular behavior (do this and then do this) which the client had been relying on
and usually that hits you when you are already operating at some scale ... and then you are in a place of real pain
you either not change it (and can not evolve) or you change it and break a lot of clients
most REST-light or pragmatic REST API's fall into that category
this is where hypermedia comes in .. sure, in the ideal world you can do everything you described above (de-duplication business logic etc).
but I would already be happy if it were simply preserving our ability to evolve without breaking existing clients which are owned and managed by different teams or differet orgs
the need for coordination is the enemy of speed

from api-style-guide.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.