[apps-discuss] JSON-Home widget example

Jan Algermissen <jan.algermissen@nordsc.com> Mon, 08 April 2013 11:33 UTC

Return-Path: <jan.algermissen@nordsc.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 3844621F8916 for <apps-discuss@ietfa.amsl.com>; Mon, 8 Apr 2013 04:33:49 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.749
X-Spam-Level:
X-Spam-Status: No, score=-1.749 tagged_above=-999 required=5 tests=[BAYES_00=-2.599, GB_ABOUTYOU=0.5, HELO_EQ_DE=0.35]
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 J4Vpgt0JTYhz for <apps-discuss@ietfa.amsl.com>; Mon, 8 Apr 2013 04:33:47 -0700 (PDT)
Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.126.186]) by ietfa.amsl.com (Postfix) with ESMTP id 8C2DA21F8168 for <apps-discuss@ietf.org>; Mon, 8 Apr 2013 04:33:47 -0700 (PDT)
Received: from [10.90.133.67] ([87.253.171.208]) by mrelayeu.kundenserver.de (node=mrbap2) with ESMTP (Nemesis) id 0MJVXP-1UR4wO3rsx-002qLe; Mon, 08 Apr 2013 13:33:44 +0200
From: Jan Algermissen <jan.algermissen@nordsc.com>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: quoted-printable
Date: Mon, 8 Apr 2013 13:11:42 +0200
Message-Id: <E30D6548-732B-4996-8363-A699A487B65B@nordsc.com>
To: "apps-discuss@ietf.org" <apps-discuss@ietf.org>
Mime-Version: 1.0 (Mac OS X Mail 6.2 \(1499\))
X-Mailer: Apple Mail (2.1499)
X-Provags-ID: V02:K0:MDQ8X2pYAaUr6frB282eATj5SdaBhREDwvGmZppVc/0 SXd+ijHAOsi6PaYFOd5aEmhVQgvEe5eHqJ0nLmTdPv9ZpQUpW5 saCs4LvWs+4qlPcnxpyiXA92gddc0szxL5mqy6i7C3+N9dahyT RUxIhSb/Q+sX15Wt8/N0toi6cWas4UT819E/FFBNpdF/fnYZVM VPNvXyDRx1Xx0kWusFd0XnN9H/W0AvOwyW6UBMo8eK4dN0X2Qz EaYTJqdkNZMWVHkYSzzHsHV/y1rttheOWUwIW3o7p83ogDurNR 3oHnv21/BfEb+Bh/O57iGW3tFazNnrtXVo3Pu/i5BfuwzODwGB KQSZrgbSez2VXwSMdq17trjXQpELE6PHTAwkANVAuV+8odWALW RsKhihjyRVaeg==
Cc: Mark Nottingham <mnot@mnot.net>
Subject: [apps-discuss] JSON-Home widget example
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: Mon, 08 Apr 2013 11:33:49 -0000

Hi Mark,

curious about your opinion on the following.

The example you provide in the draft[1] troubles me a bit since a real-life, similar case made me look at it from a different angle.

 
    "http://example.org/rel/widgets": {
         "href": "/widgets/"
       },
       "http://example.org/rel/widget": {
         "href-template": "/widgets/{widget_id}",
         "href-vars": {
           "widget_id": "http://example.org/param/widget"
         },
         ...
       }

What we have here is sort of a standard pattern for making available 'a bag of things' via HTTP.

For example, a bunch of orders can be straight forward exposed as

  /orders

and knowing that

  "http://example.org/rel/orders" : { "href" : "/orders" }

pretty much implies something like /orders/{orderId}, including the idea that adding an order is likely done with a POST to /orders and that editing an order is (maybe) achieved with PUT/PATCH/DELETE.

What troubles me is that JSON Home currently makes it necessary to define two link relations to cover a standard (in a sense) use case that could be covered with just one link relation. Or, in other words, the two link rels somehow semantically overlap, yet demand two 'specifications'. Think in terms of violating DRY.

Can't think of an improvement that does not introduce the 'pattern' into the spec, but I am nevertheless much interested in your view.

Maybe an optional {widget_id} and one rel with appropriate definition does the trick already, but hard to seperate the hints. Dunno...

Jan

[1] http://tools.ietf.org/html/draft-nottingham-json-home-02