Re: [apps-discuss] JSON Hypertext Application Language

James M Snell <jasnell@gmail.com> Sat, 09 June 2012 01:04 UTC

Return-Path: <jasnell@gmail.com>
X-Original-To: apps-discuss@ietfa.amsl.com
Delivered-To: apps-discuss@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id C1D1E11E80FE for <apps-discuss@ietfa.amsl.com>; Fri, 8 Jun 2012 18:04:54 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.363
X-Spam-Level:
X-Spam-Status: No, score=-2.363 tagged_above=-999 required=5 tests=[AWL=1.236, BAYES_00=-2.599, RCVD_IN_DNSWL_LOW=-1]
Received: from mail.ietf.org ([12.22.58.30]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 4z7PMUVnuAZx for <apps-discuss@ietfa.amsl.com>; Fri, 8 Jun 2012 18:04:53 -0700 (PDT)
Received: from mail-wi0-f172.google.com (mail-wi0-f172.google.com [209.85.212.172]) by ietfa.amsl.com (Postfix) with ESMTP id 44FC111E80E2 for <apps-discuss@ietf.org>; Fri, 8 Jun 2012 18:04:53 -0700 (PDT)
Received: by wibhj8 with SMTP id hj8so905025wib.13 for <apps-discuss@ietf.org>; Fri, 08 Jun 2012 18:04:52 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; bh=8IBLwuziz53Pmjb1G9m3U8IpPD4/1Q+lG233f+LE0nk=; b=OTtGD17lK9l2kLoVWs+x6+mMXfrvwG/NIn8rXKw6DPeXMP7wOmR4HHmLzAFUccIO+9 kWuPpFJMbnfyy91c4/IOdkyfkiFgGlG6s4SSc491Clo7LsrWjG82AWonYQxPVzAMPN/T 8mM2o2SBelKd8ujCCPjvo/IXL+jJmFFMAIG8YOWMt/rgye+ha3iSYWFlu36zyM3/0q3Y yxRz3S4VZeoQpuYcYi/RCfZpZlhjhjxBIeY6P+wuND6zHyemrIdDmPMZjSgo2BjHE5A8 /OGjFAln8aLR1OAS6XnkITrVz1phvHcKgOI+KERsmHmg1wJp6ww5H13q6/YgsO/1slzK yoZg==
Received: by 10.180.102.36 with SMTP id fl4mr4501861wib.2.1339203892185; Fri, 08 Jun 2012 18:04:52 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.223.104.12 with HTTP; Fri, 8 Jun 2012 18:04:31 -0700 (PDT)
In-Reply-To: <CABkgnnXMJX7EPXi3cqoswKbJDRupPdf5dt8Og1VqkROpM+P80A@mail.gmail.com>
References: <CANqiZJa7GrBRbiV8X=o3Xkv-WcBEdKEntiZSFhMj4efQiNPEaQ@mail.gmail.com> <CABkgnnXVFqEhS5oympA7E_GHhzYB+P5TQh1PugK5p16qNWSBVQ@mail.gmail.com> <CANqiZJbGMVzFrcsvuW2dZaq4pOEzi4x=iamxs_1etetKGeZz2A@mail.gmail.com> <CABkgnnXMJX7EPXi3cqoswKbJDRupPdf5dt8Og1VqkROpM+P80A@mail.gmail.com>
From: James M Snell <jasnell@gmail.com>
Date: Fri, 08 Jun 2012 18:04:31 -0700
Message-ID: <CABP7Rbd+siKJz7qecx-z9wZv602ceC3LWXmLfCknPrAQm6h-Sw@mail.gmail.com>
To: Martin Thomson <martin.thomson@gmail.com>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Cc: apps-discuss@ietf.org
Subject: Re: [apps-discuss] JSON Hypertext Application Language
X-BeenThere: apps-discuss@ietf.org
X-Mailman-Version: 2.1.12
Precedence: list
List-Id: General discussion of application-layer protocols <apps-discuss.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/apps-discuss>, <mailto:apps-discuss-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/apps-discuss>
List-Post: <mailto:apps-discuss@ietf.org>
List-Help: <mailto:apps-discuss-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/apps-discuss>, <mailto:apps-discuss-request@ietf.org?subject=subscribe>
X-List-Received-Date: Sat, 09 Jun 2012 01:04:55 -0000

On Fri, Jun 8, 2012 at 2:02 PM, Martin Thomson <martin.thomson@gmail.com> wrote:
>[snip]
> On 8 June 2012 12:36, Mike Kelly <mikekelly321@gmail.com> wrote:
>> Technically, according to the Web Linking specification referenced a
>> link relation type should either be registered with IANA or a URI.
>> Exposing an HTML document describing the semantics of the link at its
>> URI provides an avenue for making sense of a link that clearly can
>> work. I've written a 'browser' for HAL which lets you surf a HAL API
>> and allows you to pull up documentation as-you-go for relations that
>> are URIs.
>
> No question, HAL let's you walk the graph, but it takes a human being
> to make any sense of anything.  So, as I said, next to useless.
>[snip]

I think the most important consideration with this is: what will
developers *actually* do with the additional metadata vs. what they
*are able* to do. There is a distinct, and very practical difference.

Within the Atom format, when we defined the structure of a generic
link, we allowed for all kinds of additional metadata and that model
served as part of the basis for RFC 5988. And while the structure
allows for a great deal of potential use cases, the overall majority
of ACTUAL code focus solely on two attributes: the rel and the href.
Everything else tends to be ignored except in very specific
application cases. It's great that we can enable specific cases, but
we should not assume, necessarily, that a greater capacity for more
metadata is always a good thing.

Within the Activity Streams format (http://activitystrea.ms) there is
also working going on to define a basic mechanism for links within a
JSON Activity Stream. The mechanism I have proposed is very similar to
that seen in HAL except that it skips the object structure for a link
and just goes with Strings containing absolute IRI's. For example:

{
  "totalItems": 10,
  "links": {
    "next": "http://example.org?page=2",
    "previous": "http://example.org?page=1"
  },
  "items": [ ... ]
}

In this case, a developer is already going to have a reasonable
assumption as to what kind of resource the next and previous links
point to; and all the other metadata that is typically associated with
the generic link model simply is not necessary. An application that
understands how to process multi-paged activity streams following this
convention is going to know already to go looking for the next and
previous properties under link so there is no need at all (in this
case) for a "generic browser". The code necessary to support an
implementation of this is going to be very clear and concise.

It comes down to a tradeoff. Either we have a focused, concise,
efficient, minimal serialization that requires more application
specific handling or we have a generic, verbose, less-efficient
serialization that allows more generalized reasoning and browsing.
There are valid arguments for both, for certain, but I can see many
scenarios where HAL will just be way too verbose to be practical.

- James