On 12 Feb 2015, at 15:11, nick.p...@gmail.com wrote:
resources each of which are an order list-item. How are these similar?
Shouldn't the SIREN embedded resource be an array of order list-item just
like the HAL representation? Is there a reason it's not represented that
The flaw here is actually in the HAL representation example, which has been discussed a few times on the HAL list, the rel orders should actually be order in the example.
Under HAL - the rel key points to either a single embedded object, or a collection of embedded elements of the same rep-type. So whilst the physical serialisation is a collection against a single rel, the mental model is N separate embedded resources each with the same rel.
The HAL approach lets Javascript or dynamic folk simply refer to things like rep._embedded.order[1] which is quick, and dirty and lets you treat the serialisation format as your runtime object model.
The Siren approach instead requires you to navigate the set of embedded representations, pulling out those that match the order rel.
I think I prefer the Siren approach.
--
Mark Derricutt
http://www.theoryinpractice.net
http://www.chaliceofblood.net
http://plus.google.com/+MarkDerricutt
http://twitter.com/talios
http://facebook.com/mderricutt
--
You received this message because you are subscribed to the Google Groups "Siren Hypermedia" group.
To unsubscribe from this group and stop receiving emails from it, send an email to siren-hypermed...@googlegroups.com.
To post to this group, send email to siren-hy...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/siren-hypermedia/a4f1d9d0-fc75-4539-84ff-6635db1f6f62%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.