Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Would you mind suggesting some possible formats for this, and explaining a bit what’s necessary for “hypermedia controls”? Or is there a link somewhere that defines this more clearly? The hypermedia-oriented design link was kind of abstract.


Michael can correct me if I'm wrong, but from what I read from Fielding it's essentially having links and information about the relationship between "this" and the linked resource as first-class types in the data format.

A concrete example would be the <link> tag in HTML, which with the 'rel' and 'href' attributes can make explicit a relationship between that HTML page and e.g. the page of its author.


Yes, that's the basic idea.


I'm not sure about a format just yet, but I'm fairly certain it would be a superset of edn (as opposed to imposing it on "plain old edn"). The Document Format spec for Collection+JSON is probably not a bad starting point:

http://amundsen.com/media-types/collection/format/

Seems like it could readily be adapted to edn syntax. But I find myself drawn to the RDF concepts underlying JSON-LD, and wonder if the C+J and LD ideas could be melded together.

A solid exploration of the larger concepts involved in hypermedia controls can be found in Mike Amundsen's recent book:

Building Hypermedia APIs with HTML5 and Node

http://shop.oreilly.com/product/0636920020530.do

The basic idea is that, per Fielding, HATEOAS is an aspect of REST that shouldn't be ignored. Standardized media types with well-defined hypermedia controls allow clients that understand those standards to make state transitions without having to "know other rules" that aren't contained in the representations themselves.

Our web browsers do this all the time when we click on links and submit forms that we find in web pages. Based on the X/HTML standard, ours browsers (hypermedia clients) know what to do with links and forms, i.e. how to initiate the appropriate state transitions (build and run GET/POST requests) based on the markup semantics.

Now, if a client is driven programmatically (i.e. not by a human reasoning about the appearance and purpose of a form-button labeled "login", etc.) then you need a bit more besides links and forms. This is where attributes like "rel" (for `a` and `link`) become important. There's been a lot of work in that area, e.g. Microformats and RDFa, among others.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: