Deconstructing the Web

RESTfest 2016 [http://www.restfest.org/], Greenville, SC

Erik Wilde (), CA Technologies, API Academy
September 16, 2016

Creative Commons License [http://creativecommons.org/licenses/by/3.0/]

This work is licensed under a CC
Attribution 3.0 Unported License
[http://creativecommons.org/licenses/by/3.0/]

Contents Erik Wilde (): Deconstructing the Web

Contents

Erik Wilde (): Deconstructing the Web

(2) Summary

One of REST's constraints is that of a uniform interface. The main idea of the uniform interface is that it allows components to interact without prior knowledge of each other. Web Architecture is a great example of how a uniform interface creates a large and dynamic ecosystem of interacting components. On the other hand, Web technologies as they exist today also highlight the fact that the uniform interface from 20 years ago is not quite as uniform anymore: A growing number of specifications add to the Web's uniform interface, and often knowing which interface a component is using is necessary for successful interactions. This talks presents an overview of the various axes of the uniform interface, and introduces webconcepts.info [http://webconcepts.info/], a resource intended to provide an overview of the constantly evolving set of Web concepts that make up the Web's uniform interface. These concepts serve as the starting point for documenting RESTful services, which then can focus on documenting what they do beyond implementing the uniform interface.



Introduction

Outline (Introduction)

  1. Introduction [4]
  2. The Uniform Interface [2]
  3. Web Concepts [7]
  4. Webby Documentation [3]
  5. The Grand Plan [4]
  6. Conclusions [2]
Introduction Erik Wilde (): Deconstructing the Web

(4) About Me



Introduction Erik Wilde (): Deconstructing the Web

(5) The Service Web

Lego City

Introduction Erik Wilde (): Deconstructing the Web

(6) Why?



Introduction Erik Wilde (): Deconstructing the Web

(7) The Uniform Interface is a Lie!



The Uniform Interface

Outline (The Uniform Interface)

  1. Introduction [4]
  2. The Uniform Interface [2]
  3. Web Concepts [7]
  4. Webby Documentation [3]
  5. The Grand Plan [4]
  6. Conclusions [2]
The Uniform Interface Erik Wilde (): Deconstructing the Web

(9) Uniform Interface Theory



The Uniform Interface Erik Wilde (): Deconstructing the Web

(10) Uniform Interface Practice



Web Concepts

Outline (Web Concepts)

  1. Introduction [4]
  2. The Uniform Interface [2]
  3. Web Concepts [7]
  4. Webby Documentation [3]
  5. The Grand Plan [4]
  6. Conclusions [2]
Web Concepts Erik Wilde (): Deconstructing the Web

(12) Sunlight Melts Snowflakes

Snowflakes

Web Concepts Erik Wilde (): Deconstructing the Web

(13) Uniform Interface Patterns



Web Concepts Erik Wilde (): Deconstructing the Web

(14) Composing the Uniform Interface



Web Concepts Erik Wilde (): Deconstructing the Web

(15) Concepts

 "http-cache-directive": {
  "id": "http://webconcepts.info/concepts/http-cache-directives",
  "name-singular": "HTTP Cache Directive",
  "name-plural": "HTTP Cache Directives",
  "concepts": [{
   "max-age": {
    "id": "http://webconcepts.info/concepts/http-cache-directive/max-age",
    "details": [{
     "description": "The \"max-age\" request directive indicates that the client is unwilling to accept a response whose age is greater than the specified number of seconds. Unless the max-stale request directive is also present, the client is not willing to accept a stale response. The \"max-age\" response directive indicates that the response is to be considered stale after its age is greater than the specified number of seconds.",
     "documentation": "http://tools.ietf.org/html/rfc7234#section-5.2.1.1",
     "specification": "http://webconcepts.info/specs/IETF/RFC/7234" }]}},{
   "max-stale": {
    "id": "http://webconcepts.info/concepts/http-cache-directive/max-stale",
    "details": [{
     "description": "The \"max-stale\" request directive indicates that the client is willing to accept a response that has exceeded its freshness lifetime. If max-stale is assigned a value, then the client is willing to accept a response that has exceeded its freshness lifetime by no more than the specified number of seconds. If no value is assigned to max-stale, then the client is willing to accept a stale response of any age.",
     "documentation": "http://tools.ietf.org/html/rfc7234#section-5.2.1.2",
     "specification": "http://webconcepts.info/specs/IETF/RFC/7234" }]}},{


Web Concepts Erik Wilde (): Deconstructing the Web

(16) Specifications

 "IETF": {
  "id": "http://webconcepts.info/specs/IETF/",
  "name": "Internet Engineering Task Force",
  "short": "IETF",
  "series": [{
   "I-D": {
    "id": "http://webconcepts.info/specs/IETF/I-D/",
    "name": "Internet Draft",
    "short": "I-D",
    "specs": [{
     "amundsen-richardson-foster-alps": {
      "id": "http://webconcepts.info/specs/IETF/I-D/amundsen-richardson-foster-alps",
      "title": "Application-Level Profile Semantics (ALPS)",
      "name": "Internet Draft amundsen-richardson-foster-alps",
      "URI": "urn:ietf:id:amundsen-richardson-foster-alps",
      "URL": "http://tools.ietf.org/html/draft-amundsen-richardson-foster-alps",
      "abstract": "This document describes ALPS, a data format for defining simple descriptions of application-level semantics, similar in complexity to HTML microformats. An ALPS document can be used as a profile to explain the application semantics of a document with an application-agnostic media type (such as HTML, HAL, Collection+JSON, Siren, etc.). This increases the reusability of profile documents across media types.",
      "concepts": [{
       "media-type": "application/alps+json" }, {
       "media-type": "application/alps+xml" }]}},{


Web Concepts Erik Wilde (): Deconstructing the Web

(17) Concepts and Specifications



Web Concepts Erik Wilde (): Deconstructing the Web

(18) HTTP/1.1 Concepts

<service primary="IETF" secondary="RFC" id="7231">
    <title>Hypertext Transfer Protocol (HTTP/1.1): Semantics and Content</title>
    <documentation source="http://tools.ietf.org/html/rfc7231">The Hypertext Transfer Protocol (HTTP) is an application-level protocol for distributed, collaborative, hypertext information systems. This document defines the semantics of HTTP/1.1 messages as expressed by request methods, request header fields, response status codes, and response header fields, along with the payload of messages (metadata and body content) and mechanisms for content negotiation.</documentation>
    <http-header def="Content-Type">
        <documentation source="http://tools.ietf.org/html/rfc7231#section-3.1.1.5">The "Content-Type" header field indicates the media type of the associated representation: either the representation enclosed in the message payload or the selected representation, as determined by the message semantics. The indicated media type defines both the data format and how that data is intended to be processed by a recipient, within the scope of the received message semantics, after any content codings indicated by Content-Encoding are decoded.</documentation>
    <http-status def="404" desc="Not Found">
        <documentation source="http://tools.ietf.org/html/rfc7231#section-6.5.4">The 404 (Not Found) status code indicates that the origin server did not find a current representation for the target resource or is not willing to disclose that one exists. A 404 status code does not indicate whether this lack of representation is temporary or permanent; the 410 (Gone) status code is preferred over 404 if the origin server knows, presumably through some configurable means, that the condition is likely to be permanent.</documentation>
    <http-method def="GET">
        <documentation source="http://tools.ietf.org/html/rfc7231#section-4.3.1">The GET method requests transfer of a current selected representation for the target resource. GET is the primary mechanism of information retrieval and the focus of almost all performance optimizations. Hence, when people speak of retrieving some identifiable information via HTTP, they are generally referring to making a GET request.</documentation>


Webby Documentation

Outline (Webby Documentation)

  1. Introduction [4]
  2. The Uniform Interface [2]
  3. Web Concepts [7]
  4. Webby Documentation [3]
  5. The Grand Plan [4]
  6. Conclusions [2]
Webby Documentation Erik Wilde (): Deconstructing the Web

(20) Discoverable Concepts



Webby Documentation Erik Wilde (): Deconstructing the Web

(21) Focus on the Surface



Webby Documentation Erik Wilde (): Deconstructing the Web

(22) Extend the Surface



The Grand Plan

Outline (The Grand Plan)

  1. Introduction [4]
  2. The Uniform Interface [2]
  3. Web Concepts [7]
  4. Webby Documentation [3]
  5. The Grand Plan [4]
  6. Conclusions [2]
The Grand Plan Erik Wilde (): Deconstructing the Web

(24) Describe Services



The Grand Plan Erik Wilde (): Deconstructing the Web

(25) Harvest Descriptions for Aggregation



The Grand Plan Erik Wilde (): Deconstructing the Web

(26) Description-Driven Design Guide



The Grand Plan Erik Wilde (): Deconstructing the Web

(27) Monitor Service Behavior



Conclusions

Outline (Conclusions)

  1. Introduction [4]
  2. The Uniform Interface [2]
  3. Web Concepts [7]
  4. Webby Documentation [3]
  5. The Grand Plan [4]
  6. Conclusions [2]
Conclusions Erik Wilde (): Deconstructing the Web

(29) Be RESTful!



Conclusions Erik Wilde (): Deconstructing the Web

(30) Thanks! Q&A

What's Next?

September 16, 2016 RESTfest 2016 [http://www.restfest.org/], Greenville, SC