Re: [core] Observe Cancellation: The outcome

Carsten Bormann <cabo@tzi.org> Sat, 08 March 2014 17:15 UTC

Return-Path: <cabo@tzi.org>
X-Original-To: core@ietfa.amsl.com
Delivered-To: core@ietfa.amsl.com
Received: from localhost (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 753DE1A02DE for <core@ietfa.amsl.com>; Sat, 8 Mar 2014 09:15:58 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.551
X-Spam-Level:
X-Spam-Status: No, score=-1.551 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, HELO_EQ_DE=0.35, SPF_HELO_PASS=-0.001] autolearn=no
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id NobYsgl9mZMB for <core@ietfa.amsl.com>; Sat, 8 Mar 2014 09:15:52 -0800 (PST)
Received: from informatik.uni-bremen.de (mailhost.informatik.uni-bremen.de [IPv6:2001:638:708:30c9::12]) by ietfa.amsl.com (Postfix) with ESMTP id 7B4781A02D0 for <core@ietf.org>; Sat, 8 Mar 2014 09:15:52 -0800 (PST)
X-Virus-Scanned: amavisd-new at informatik.uni-bremen.de
Received: from smtp-fb3.informatik.uni-bremen.de (smtp-fb3.informatik.uni-bremen.de [134.102.224.120]) by informatik.uni-bremen.de (8.14.5/8.14.5) with ESMTP id s28HFaK7005391; Sat, 8 Mar 2014 18:15:36 +0100 (CET)
Received: from [10.200.2.4] (unknown [62.232.113.211]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by smtp-fb3.informatik.uni-bremen.de (Postfix) with ESMTPSA id 10E9BF4; Sat, 8 Mar 2014 18:15:35 +0100 (CET)
Content-Type: text/plain; charset="windows-1252"
Mime-Version: 1.0 (Mac OS X Mail 7.2 \(1874\))
From: Carsten Bormann <cabo@tzi.org>
In-Reply-To: <CF40AD3C.1331B%thomas.fossati@alcatel-lucent.com>
Date: Sat, 08 Mar 2014 17:15:30 +0000
X-Mao-Original-Outgoing-Id: 415991730.059636-3189fc390a0e470f30e1d0b1fe1f836e
Content-Transfer-Encoding: quoted-printable
Message-Id: <307ACD9F-86D9-47A9-8D4B-DEA9BCB9C360@tzi.org>
References: <5A8F12CD-25B5-4915-A298-0AB0F6FA47F7@tzi.org> <CF40AD3C.1331B%thomas.fossati@alcatel-lucent.com>
To: "FOSSATI, Thomas (Thomas)" <thomas.fossati@alcatel-lucent.com>
X-Mailer: Apple Mail (2.1874)
Archived-At: http://mailarchive.ietf.org/arch/msg/core/SPtxUjBCmku2UcsMkRtJdDJyOn4
Cc: "core@ietf.org WG" <core@ietf.org>
Subject: Re: [core] Observe Cancellation: The outcome
X-BeenThere: core@ietf.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: "Constrained RESTful Environments \(CoRE\) Working Group list" <core.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/core>, <mailto:core-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/core/>
List-Post: <mailto:core@ietf.org>
List-Help: <mailto:core-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/core>, <mailto:core-request@ietf.org?subject=subscribe>
X-List-Received-Date: Sat, 08 Mar 2014 17:15:58 -0000

On 08 Mar 2014, at 16:10, FOSSATI, Thomas (Thomas) <thomas.fossati@alcatel-lucent.com> wrote:

> b) reusing an existing request code as GET (or any other already allocated
>   method).

(Personal view follows, no hat:)

There is no “reuse”.

This is still a GET: A client is obtaining a representation of the resource.
At the level of the REST model, there is no change: These representations are cacheable, they can be operated on by chains of proxies (“layered system”) only some of which make use of Observe, maintaining a uniform interface, and so on.

The details of how the GET request is operated are in the Observe request option (absent, =0, =1).
Setting up an Observation relationship asks for future representations as well; renewing checks and possible re-establishes it, canceling ends the indication of interest.
But this is not application state: This is entirely an optimization that saves polling (or, long-polling, which goes much further in the way of bending the REST principles).
Saying this is “not RESTful” is tantamount to claiming HTTP is not RESTful because it involves setting up TCP state.

The Observation relationship state is not modeled as a resource, because it really isn’t one.
Passing this information along with a normal GET request leads to some unneeded semantics (e.g., many use cases of a cancel do not need a final representation).  That causes tremendous cognitive dissonance in a design that is otherwise as clean as that of CoAP, but is not really a big problem in practice.

A more general comment (not directed to Thomas): I would prefer it if people actually applied the principles laid out in section 5 of [REST] before calling something more or less “RESTful”.  E.g., textual representation of protocol elements is completely irrelevant to REST (and CoAP does away with ease with this principle, which is indeed very useful in more powerful systems).  

Exercise for the reader: Find the places in [REST] where the author criticizes HTTP for getting something wrong that we did get right in CoAP.

Grüße, Carsten

   [REST]     Fielding, R., "Architectural Styles and the Design of
              Network-based Software Architectures", Ph.D. Dissertation,
              University of California, Irvine, 2000, <http://
              www.ics.uci.edu/~fielding/pubs/dissertation/
              fielding_dissertation.pdf>.