3 ms·
> In the original Fielding paper, REST is explicitly defined as an architecture for "large-grained resources" aka "documents". So this "hack" the author perceiv
by TeMPOraL 6y ago
> In the original Fielding paper, REST is explicitly defined as an architecture for "large-grained resources" aka "documents". So this "hack" the author perceives is inherent to REST. If your API is small-grained (like most HTTP/web/JSON APIs are), then you shouldn't be using REST in the first place
This reminds me of the time when people took a format meant for sprinkling some metadata here and there on a piece of a large document, and started using it primarily for writing "documents" where markup/data ratio is > 2.
I'm of course talking about XML here.
- slver 6y agoThe current REST practices make SOAP look like a marvel of engineering. You can tell many of the current "gurus" have no idea what came before (so they reinvented it poorly).
- spiralx 6y agoIf you're not using the full XML ecosystem then yes, it can be overly verbose for just a simple document, especially if the person who defined the format went all in on "XML-ising" it - the worst and most common offender being using elements to define lists of key-value pairs (especially if both have an element wrapped in another element!) instead of using attributes, followed by not specifying a default namespace so everything has "xml:" in front of it making it hard to work out what the hell the thing actually is as well as pointlessly inflating the file size. When you're dealing with large amounts of structured data of different kinds that you want to combine in many different ways there's not really anything that comes close to the combination of XML, XPath, schemas, XSLT and XQuery. But if you're not something like the huge medical publisher I worked for then you definitely don't need all that.
- TeMPOraL 6y agoI agree. I didn't mention this in my original comment, but the follow-up to the story is: the industry eventually moved on to leaner formats like JSON, but in the process, threw away all that made XML very useful over the years - like schemas, for example. Arguably, this is a step back.
- spiralx 6y agoI do maintain a couple of JSON schemas and they're a bit clunky due to the JSON syntax (although they're nicer in YAML which my validator can use) but the newer versions of the spec do allow you do specify complex enough rules to cover most cases. But an equivalent to XSLT doesn't make a huge amount of sense for JSON. I've got an XSLT stylesheet I wrote you can add to an HTML page via the xml-stylesheet directive that turns it into a pretty-printed display of its own markup, complete with syntax highlighting. Pointless but neat that it's possible :)