A couple questions regarding hypermedia/restful api

57 views
Skip to first unread message

Silviu Constantin Voicu

unread,
Apr 26, 2018, 5:30:04 AM4/26/18
to Hypermedia Web
1. First about H Factor. According to this https://gtramontina.github.io/h-factors/ only UBER is complete, and  Mason come out on the second place. Other popular formats like HAL, Siren, Hydra they missing some of them. 
Now, how much H Factor should be good enough for choosing only one format, and not go with multiple formats for simplifications, and which may be that?

2. From this blog post Model Actions, Not Data I understand that in order to design an hypermedia api, we should go first on modelling the domain first and use that as base for the api. Either we identified use cases or going domain events first, those will become the base of the action links and the read model which will inform the user and contain links to go do some activities and achieving his goal.
And this way, we build a state machine, and not matter if the user receive an hypermedia format or html app he will only be able to do the same action and see the same value, no matter what. 
I know that this was more a thought than a question but still, what can we do to take things in this direction and not on the rad/doc first api?

3.Should we embed semantic information in the hypermedia format, maybe using hydra, or to put those semantic info into the client that consume the hypermedia api? 

mca

unread,
Apr 26, 2018, 3:15:40 PM4/26/18
to hyperme...@googlegroups.com
good to see your posts here.

i'll jump in with comments, but there are several others on this list that can contribute to the convo

1) "H-Factor Complete" is not really a goal. formats are _designed_ to support (or not support) selected factors/affordances. While UBER scores well, it is pretty abstract and tough to program against. I have not run into many APIs that use it.  And HAL, while a "low scorer" for H-Factots is one of the most popular of the new formats.

My advice is to chronicle what factors you need in the message (rather than in code) and use that as your guide for picking a format. And be prepared to change to (or add) other formats as you gain more experience. There is no "one ring to rule them all."

2) desiging the API (based on actions, object, data, etc.) is always an art, not a science. i, personally, find that modeling actions (or user-stories) results in a more rich design that covers lots of edge cases. it can also prevent ppl from falling into the "entity service" anti-pattern. i have been using McLarty's Service Canvas in the last year or so to help with this.

3) i favor encapulating the domain semantics (bounded context) in an ALPS document and mapping that to the foramt in use. since some formats will have more/less h-factor elements, i then fill in the missing pieces by mapping the semantics to the client code. the more ricth the format, the less domain-specific the client code (and vice versa).

hope this helps.

--
You received this message because you are subscribed to the Google Groups "Hypermedia Web" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hypermedia-web+unsubscribe@googlegroups.com.
To post to this group, send email to hypermedia-web@googlegroups.com.
Visit this group at https://groups.google.com/group/hypermedia-web.
For more options, visit https://groups.google.com/d/optout.

Martynas Jusevičius

unread,
Apr 27, 2018, 6:50:19 PM4/27/18
to hyperme...@googlegroups.com
If you can limit yourself to datasources that support SPARQL, the hypermedia API definition becomes
much more straightforward.
https://atomgraph.github.io/Linked-Data-Templates/
To unsubscribe from this group and stop receiving emails from it, send an email to hypermedia-we...@googlegroups.com.
To post to this group, send email to hyperme...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Hypermedia Web" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hypermedia-we...@googlegroups.com.
To post to this group, send email to hyperme...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages