REST, Hypermedia and the Semantic Gap Why "RMM Level-3" - - PowerPoint PPT Presentation

rest hypermedia
SMART_READER_LITE
LIVE PREVIEW

REST, Hypermedia and the Semantic Gap Why "RMM Level-3" - - PowerPoint PPT Presentation

REST, Hypermedia and the Semantic Gap Why "RMM Level-3" is not good enough. +MikeAmundsen @mamund Introductions Mike Amundsen 25 years in computing 14 books on programming 10 years w/ "REST" "RESTful


slide-1
SLIDE 1

REST, Hypermedia and the Semantic Gap

+MikeAmundsen @mamund

Why "RMM Level-3" is not good enough.

slide-2
SLIDE 2

Introductions

  • Mike Amundsen
  • 25 years in computing
  • 14 books on programming
  • 10 years w/ "REST"
  • "RESTful Web APIs"

w/ Leonard Richardson

slide-3
SLIDE 3

Learning Hypermedia Clients

  • Focus on the client side code
  • Covers human-driven & M2M
  • Lots of code!
  • Due in fall 2015
  • @LCHBook #LCHProject
slide-4
SLIDE 4

Hallway Conversations Podcast

Hosted by Phil Japikse, Steve Bohlen, Lee Brandt, James Bender Website: www.hallwayconversations.com iTunes: http://bit.ly/hallway_convo_itunes Feed Burner: http://bit.ly/hallway_convo_feed Also available through Windows Store

slide-5
SLIDE 5

Let's talk about...

  • Fielding's REST
  • HTTP APIs & CRUD
  • Hypermedia APIs
  • The Semantic Gap
slide-6
SLIDE 6

REST - The Short Story

slide-7
SLIDE 7

Fielding's Dissertation

"This dissertation defines a framework for understanding software architecture via architectural styles and demonstrates how styles can be used to guide the architectural design of network-based application software."

  • Fielding, 2000
slide-8
SLIDE 8

REST in one slide

Properties

  • Performance
  • Scalability
  • Simplicity
  • Modifiability
  • Visibility
  • Portability
  • Reliability
slide-9
SLIDE 9

REST in one slide

Properties

  • Performance
  • Scalability
  • Simplicity
  • Modifiability
  • Visibility
  • Portability
  • Reliability

+ Requirements

  • Low-Entry Barrier
  • Extensibility
  • Distributed Hypermedia
  • Internet Scale
slide-10
SLIDE 10

REST in one slide

Properties

  • Performance
  • Scalability
  • Simplicity
  • Modifiability
  • Visibility
  • Portability
  • Reliability

+ Requirements

  • Low-Entry Barrier
  • Extensibility
  • Distributed Hypermedia
  • Internet Scale

= Constraints

  • Client-Server
  • Stateless
  • Cache
  • Uniform Interface
  • Layered System
  • Code on Demand
slide-11
SLIDE 11

Affordances

"When I say hypertext, I mean the simultaneous presentation of information and controls such that the information becomes the affordance through which the user (or automaton) obtains choices and selects actions." - Fielding, 2008

slide-12
SLIDE 12

Affordances

"When I say hypertext, I mean the simultaneous presentation of information and controls such that the information becomes the affordance through which the user (or automaton) obtains choices and selects actions." - Fielding, 2008

slide-13
SLIDE 13

Affordances

slide-14
SLIDE 14

HTTP APIs - The Shared Story

slide-15
SLIDE 15

RESTful Web Services - 2007

"Our ultimate goal in this book is to reunite the programmable web with the human web. We envision a single interconnected network: a World Wide Web that runs on one set of servers, uses one set of protocols, and obeys

  • ne set of design principles."
  • Richardson & Ruby, 2008
slide-16
SLIDE 16

Richardson Maturity Model (RMM)

slide-17
SLIDE 17

Richardson Maturity Model (RMM)

slide-18
SLIDE 18

Richardson Maturity Model (RMM)

slide-19
SLIDE 19

Richardson Maturity Model (RMM)

slide-20
SLIDE 20

Richardson Maturity Model (RMM)

slide-21
SLIDE 21

Richardson Maturity Model (RMM)

slide-22
SLIDE 22

Richardson Maturity Model (RMM)

slide-23
SLIDE 23

CRUD in one slide

slide-24
SLIDE 24

Gregorio's Four Questions (2006)

  • 1. What are the URIs?
  • 2. What are the formats?
  • 3. What methods are supported at each URI?
  • 4. What status codes could be returned?
slide-25
SLIDE 25

Common CRUD Guidance

  • URI design is the primary

taskhttp://{server}/{collection}/{id}

  • Focus on serializing domain
  • bjects{customer: {name:"mike",...}}
  • Use URIs to express object

relationshipshttp://example.com/users/abc/

friends/xyz

  • Use controller URIs to handle service

taskshttp://example.com/reports/1

slide-26
SLIDE 26

To-Do CRUD App Demo

slide-27
SLIDE 27

To-Do CRUD App Demo

slide-28
SLIDE 28

To-Do CRUD App Demo

slide-29
SLIDE 29

Hypermedia APIs - The Linked Story

slide-30
SLIDE 30

RESTful Web APIs - 2013

"RESTful Web Services covered hypermedia, but it wasn’t central to the book. It was possible to skip the hypermedia parts

  • f the book and still design a functioning API.

By contrast, RESTful Web APIs is effectively a book about hypermedia." - Richardson & Amundsen

slide-31
SLIDE 31

H-Factors (2010)

Link Factors

  • LO
  • LE
  • LT
  • LN
  • LI
slide-32
SLIDE 32

H-Factors

Control Factors

  • CR
  • CU
  • CM
  • CL
slide-33
SLIDE 33

H-Factors

slide-34
SLIDE 34

Hypermedia in one slide

  • {"link" :

{"rel" : "help", "href" : "..."} }

  • {"image" :

{"rel" : "logo", "href" : "..."} }

  • {"form" :

{"rel" : "edit", "href" : "...", "method" : "put", "data" : [{"name":"...","value":"..."}] } }

slide-35
SLIDE 35

To-Do Hypermedia Demo App

slide-36
SLIDE 36

To-Do Hypermedia Demo App

slide-37
SLIDE 37

To-Do Hypermedia Demo App

slide-38
SLIDE 38

The Semantic Gap - The Future Story

slide-39
SLIDE 39

Profiles - from XMDP to ALPS

  • Dublin Core (2000)
  • XMDP for HTML (2003)
  • Microformats for HTML (2005)
  • Activity Streams (2011)
  • Schema.org (2011)
  • ALPS for HTML (2011)
  • Profile Link Relation (2013)
  • ALPS Stand-alone (2013)
slide-40
SLIDE 40

Shared Understanding

  • Focus on the domain vocabulary
  • Independent of protocol (HTTP, XMPP, etc.)
  • Independent of format (HTML, Cj, HAL, etc.)
slide-41
SLIDE 41

Shared Understanding

slide-42
SLIDE 42

Shared Understanding

slide-43
SLIDE 43

Shared Understanding

slide-44
SLIDE 44

Affordance Aspects

For the purposes of applying affordances to hypermedia, there are four aspects to consider:

<proto safe="true|false" idempotent="true|false" mutable="true|false" transclusion="true|false" />

slide-45
SLIDE 45

Affordance Aspects

slide-46
SLIDE 46

Linking

"[Links are] necessary to connect the data we have into a web, a serious, unbounded web in which one can find all kinds of things." - Tim Berners-Lee, 2006-09

slide-47
SLIDE 47

Linking

"[Links are] necessary to connect the data we have into a web, a serious, unbounded web in which one can find all kinds of things." - Tim Berners-Lee, 2006-09

slide-48
SLIDE 48

Linking

slide-49
SLIDE 49

Linking

slide-50
SLIDE 50

ALPS in one slide

SoC is key

  • Format
  • Protocol
  • Domain
  • Workflow

<alps> <doc/> <descriptor type="semantic"/> <descriptor type="safe|idempotent|unsafe"/> </alps>

slide-51
SLIDE 51

To-Do ALPS-driven Demo App

slide-52
SLIDE 52

To-Do ALPS-driven Demo App

slide-53
SLIDE 53

To-Do ALPS-driven Demo App

slide-54
SLIDE 54

To-Do ALPS-driven Demo App

slide-55
SLIDE 55

Summary

slide-56
SLIDE 56

Summary

  • REST
  • HTTP APIs
  • Hypermedia APIs
  • The Semantic Gap
slide-57
SLIDE 57

Summary - REST

  • Network Architecture
  • Properties + Requirements = Constraints
  • Data is an architectural element
  • Uniform API for all
  • Use hypermedia to change state
  • Information is the affordance
slide-58
SLIDE 58

Summary - CRUD

  • Resource Oriented Architecture
  • URI + Object = Resource
  • Focus on URIs
  • Manipulate Resources w/ HTTP Methods
  • Use objects to change state
  • URI is the affordance
slide-59
SLIDE 59

Summary - Hypermedia

  • Task Oriented Architecture
  • Data + Instructions = Representation
  • Focus on Tasks
  • Manipulate state via hypermedia controls
  • Message is the affordance
slide-60
SLIDE 60

Summary - Semantic Gap

  • Problem Domain Modeling
  • Data + Transitions = Model
  • Focus on open world (power law)
  • Separate domain model from
  • protocol
  • format
  • workflow
slide-61
SLIDE 61

REST, Hypermedia and the Semantic Gap

+MikeAmundsen @mamund

Why "RMM Level-3" is not good enough.