Layer 7 Confidential 1
Mike Amundsen
The Costs and Benefits of Building Hypermedia APIs (with Node.js) - - PowerPoint PPT Presentation
Mike Amundsen The Costs and Benefits of Building Hypermedia APIs (with Node.js) Layer 7 Confidential 1 Mike Amundsen Author Presenter Software Explorer Principal API Architect Layer 7 Confidential 2 OK, lets get started
Layer 7 Confidential 1
Mike Amundsen
Layer 7 Confidential 2
Mike Amundsen
Layer 7 Confidential 3
Layer 7 Confidential 4
"a looking at, viewing, beholding”
Layer 7 Confidential 5
"a looking at, viewing, beholding”
Layer 7 Confidential 6
“doing”
Layer 7 Confidential 7
“doing”
Layer 7 Confidential 8
Layer 7 Confidential 10
Affordances
“The value of a well-designed object, Is when it has such a rich set of affordances, That the people who use it, Can do things with it, That the designer never imagined.”
Layer 7 Confidential 11
Affordances
“The value of a well-designed object, Is when it has such a rich set of affordances, That the people who use it, Can do things with it, That the designer never imagined.”
Layer 7 Confidential 12
Affordances
“The value of a well-designed object, Is when it has such a rich set of affordances, That the people who use it, Can do things with it, That the designer never imagined.”
Layer 7 Confidential 13
Affordances
“The value of a well-designed object, Is when it has such a rich set of affordances, That the people who use it, Can do things with it, That the designer never imagined.”
Layer 7 Confidential 14
Affordances
“The value of a well-designed object, Is when it has such a rich set of affordances, That the people who use it, Can do things with it, That the designer never imagined.”
Layer 7 Confidential 15
Layer 7 Confidential 16
Affordances
ecologically available information.
the environment. Theory of Affordances, 1979
Layer 7 Confidential 17
Affordances
The Design of Everyday Things, 1988
Layer 7 Confidential 18
Affordances
Knowledge (“head” vs. “world”)
April 17, 2012 APIs to Affordances : WS-REST 2012 18
Property Knowledge in the World Knowledge in the Head Learning Learning not required. Interpretation substitutes for learning. How easy it is to interpret information is the world depends upon how well it exploits natural mappings and constraints. Requires learning, which can be considerable. Learning is made easier if there is meaning of structure to the material (or if there is a good mental model). Efficiency
Tends to be slowed up by the need to find and interpret the external information. Can be very efficient Ease of use at first encounter High Low
Layer 7 Confidential 19
Affordances
control information embedded within, or as a layer above, the presentation of information“ (2001)
presentation of information and controls such that the information becomes the affordance through which the user
Architectural Styles and the Design
Layer 7 Confidential 20
Affordances
control information embedded within, or as a layer above, the presentation of information“ (2001)
presentation of information and controls such that the information becomes the affordance through which the user
Architectural Styles and the Design
Layer 7 Confidential 21
Affordances
Layer 7 Confidential 22
Affordances
Layer 7 Confidential 23
Maze+XML
Layer 7 Confidential 24
Maze+XML
between clients and servers. It can be used to implement simple mazes, adventure games, and other related data.”
collection, maze, start, exit, current, north, south, east, west
Layer 7 Confidential 25
Maze+XML
Message
Layer 7 Confidential 26
Maze+XML Server
Layer 7 Confidential 27
Maze+XML
Client
Layer 7 Confidential 28
Maze+XML
Client
Layer 7 Confidential 29
Maze+XML
Client
Layer 7 Confidential 30
Maze+XML
Client Code
Layer 7 Confidential 31
Maze+XML
Layer 7 Confidential 32
Maze+XML
domain specific semantics.”
transparently that tracks the state of the user agent as it navigates between representations.”
Layer 7 Confidential 33
Maze+XML
Darrel Miller – C#
Layer 7 Confidential 34
lot harder to deal with in bash, because hypermedia
easier to deal with…”
Maze+XML
Layer 7 Confidential 35
Yannick Loiseau - Python
Maze+XML
Layer 7 Confidential 36
Yannick Loiseau - Bash
Maze+XML
Layer 7 Confidential 37
Maze+XML
Layer 7 Confidential 38
H-Factors
Layer 7 Confidential 39
level of hypermedia support within that media-type.”
contrast media types in order to aid in selecting the proper media-type(s) for your implementation.”
H-Factors
REST: From Research to Practice : Hypermedia Types, 2011
Layer 7 Confidential 40
H-Factors
Analyzing Media Types
Layer 7 Confidential 41
H-Factors
Analyzing Media Types
Layer 7 Confidential 42
H-Factors
Analyzing Media Types
Layer 7 Confidential 43
H-Factors
(LO, LE, LT, LI, LN)
(CR, CU, CM, CL)
Layer 7 Confidential 44
H-Factors
(LO, LE, LT, LI, LN)
(CR, CU, CM, CL)
Layer 7 Confidential 45
H-Factors
Linking
Layer 7 Confidential 46
H-Factors
Linking
Layer 7 Confidential 47
H-Factors
Linking
Layer 7 Confidential 48
H-Factors
Linking
Layer 7 Confidential 49
H-Factors
Linking
Layer 7 Confidential 50
H-Factors
(LO, LE, LT, LI, LN)
(CR, CU, CM, CL)
Layer 7 Confidential 51
H-Factors
Control
Layer 7 Confidential 52
H-Factors
Control
Layer 7 Confidential 53
H-Factors
Control
Layer 7 Confidential 54
H-Factors
Control
Layer 7 Confidential 55
H-Factors
“Media Type”
Layer 7 Confidential 56
H-Factors
Layer 7 Confidential 57
H-Factors
Layer 7 Confidential 58
Collection+JSON
Layer 7 Confidential 59
Collection+JSON
support management and querying of simple collections.”
Layer 7 Confidential 60
Message
Collection+JSON
Layer 7 Confidential 61
Message
Collection+JSON
Layer 7 Confidential 62
Message
Collection+JSON
Layer 7 Confidential 63
Message
Collection+JSON
Layer 7 Confidential 64
Message
Collection+JSON
Layer 7 Confidential 65
Server
Collection+JSON
Layer 7 Confidential 66
Server
Collection+JSON
Layer 7 Confidential 67
Server
Collection+JSON
Layer 7 Confidential 68
Client Code
Collection+JSON
Layer 7 Confidential 69
Client Code
Collection+JSON
Layer 7 Confidential 70
Client Code
Collection+JSON
Layer 7 Confidential 71
Client App
Collection+JSON
Layer 7 Confidential 72
Client App
Collection+JSON
Layer 7 Confidential 73
Collection+JSON
Layer 7 Confidential 74
Collection+JSON
that have the ability to self-adapt the user interface to the usage context.”
Layer 7 Confidential 75
Collection+JSON
looking for…”
community around this format…”
Layer 7 Confidential 76
Collection+JSON
and files.”
with the Mac app and subsequently the API. We just started working with another developer who's making amazing progress.”
Layer 7 Confidential 77
Collection+JSON
addressed…”
should consider [creating] my own media type.”
Layer 7 Confidential 78
Collection+JSON
Layer 7 Confidential 79
Affordance Aspects
Layer 7 Confidential 80
Affordance Aspects
hypermedia, there are four important aspects to consider”
Layer 7 Confidential 81
Affordance Aspects
actions such as HEAD, and GET.
Layer 7 Confidential 82
Affordance Aspects
actions such as HEAD, and GET.
categorized as "unsafe" actions.
Layer 7 Confidential 83
Affordance Aspects
property set to "get" it represents an idempotent action.
Layer 7 Confidential 84
Affordance Aspects
property set to "get" it represents an idempotent action.
affordance represents a non-idempotent action.
Layer 7 Confidential 85
Affordance Aspects
Layer 7 Confidential 86
Affordance Aspects
Layer 7 Confidential 87
Affordance Aspects
Layer 7 Confidential 88
Affordance Aspects
Layer 7 Confidential 89
Affordance Aspects
Layer 7 Confidential 90
Affordance Aspects
Layer 7 Confidential 91
Affordance Aspects
Layer 7 Confidential 92
Affordance Aspects
Layer 7 Confidential 93
ALPS for HTML
Layer 7 Confidential 94
ALPS for HTML
is to document the application-level semantics of a particular implementation.”
for a specific application domain: Micro-blogging.”
Layer 7 Confidential 95
ALPS for HTML
applications without seeing each other's work or accessing a running "reference" implementation.
definitions found in this document (and the referenced RFCs) as the sole instruction.
Layer 7 Confidential 96
ALPS for HTML
Messages
Layer 7 Confidential 97
ALPS for HTML
Messages
Layer 7 Confidential 98
ALPS for HTML
Messages
Layer 7 Confidential 99
ALPS for HTML
Server Code
Layer 7 Confidential 100
ALPS for HTML
Client Code
Layer 7 Confidential 101
ALPS for HTML
Client App
Layer 7 Confidential 102
ALPS for HTML
Client Bot
Layer 7 Confidential 103
ALPS for HTML
Client Bot
Layer 7 Confidential 104
ALPS for HTML
Client Bot
Layer 7 Confidential 105
ALPS for HTML
Layer 7 Confidential 106
ALPS for HTML
Rstat.us – Carol Nichols
and openness.”
site, the ALPS microblogging spec means adding a few attributes rather than having to maintain a totally separate API interface.”
presenting the ALPS spec is [too] flat.”
Layer 7 Confidential 107
ALPS for HTML
Rstat.us – Carol Nichols
Layer 7 Confidential 108
ALPS for HTML
Rstat.us – Carol Nichols
Layer 7 Confidential 109
ALPS for HTML
Layer 7 Confidential 110
ALPS for HTML
Layer 7 Confidential 111
ALPS for HTML
Layer 7 Confidential 112
Methodology
Layer 7 Confidential 113
match, consider designing your own.
Methodology
Layer 7 Confidential 114
than one.
Methodology
Layer 7 Confidential 115
Methodology
Layer 7 Confidential 116
Methodology
Layer 7 Confidential 117
When you are sure you have:
Then, and only then…
Methodology
Layer 7 Confidential 118
Methodology
Layer 7 Confidential 119
Methodology
Layer 7 Confidential 120
Methodology
Layer 7 Confidential 121
Methodology
Layer 7 Confidential 122
Methodology
Layer 7 Confidential 123
Methodology
Layer 7 Confidential 124
Methodology
Layer 7 Confidential 125
Methodology
Layer 7 Confidential 126
Mike Amundsen
@mamund