READY. LOAD HYPERDUNGEON
James Pozenel
Senior Software Engineer
Technical Lead on QLMS 2.0
Quicken Loans
@lectrotext @LunchBusDetroit
0. Swamp of Pox (RPC)
1. Resources
2. HTTP
3. HATEOAS
READY. Load HYPERDungeon You are standing in an open field west of a white house, with a boarded front door. There is a small mailbox here. >
{
"id": 1,
"room": "You are standing in an open field west of a white house, with a boarded front door. There is a small mailbox here."
}
{
"id": 1,
"room": "You are standing in an open field west of a white house, with a boarded front door. There is a small mailbox here."
}
<a href="http://hyperdungeon.com" rel="index" title="HyperDungeon" data-desc="It's hyper-action in a hyper-dungeon!">HyperDungeon!</a>
<form action="/action" method="post">
You are standing in an open field west of a white house, with a boarded front door.
There is a small mailbox here.
"The user progresses through the application by selecting links (
state transitions
), resulting in the next page (
representing the next state of the application
) being transferred to the user and rendered." -- Roy Fielding
HATEOAS is a web interface
(like a web page) for the application.
Designing good experience
for a Developer (aka - The User).
Hypermedia gives a Resource
additional properties
Data + Metadata
You are in an open field west of a big white house with a boarded front door. There is a small mailbox here. > open mailbox Opening the mailbox reveals: A leaflet. > look You are in an open field west of a big white house with a boarded front door. There is a small mailbox here. The mailbox contains: A leaflet.
POST http://hyperdungeon.com/items/1
{
"action":"open"
}
200 OK
GET http://hyperdungeon.com/items/1
{ "id": 1, "name": "small mailbox", "type": "container", "moveable": false, "state": "open", "links": [ "contents": { "href":"http://hyperdungeon.com/items/2",... ]
}
GET http://hyperdungeon.com/rooms/1
> get mailbox
An interesting idea, but...
POST http://hyperdungeon.com/item/1
{
"action":"get"
}
403 Forbidden
{ "id": 1, "name": "small mailbox", "type": "container", "moveable": false, "state": "open", "links": [ "contents": {"href":"http://hyperdungeon.com/items/2"}, "self": {"href":"http://hyperdungeon.com/items/1"} ]
}
{
"id": 5,
"name": "brown sack",
"description": "An elongated brown sack, smelling of hot peppers."
"type": "container",
"moveable": true,
"state": "closed",
"links": [
"self": {
"href":"http://hyperdungeon.com/items/5"
"title": "brown sack"
},
"index": {
"href":"http://hyperdungeon.com/items"
"title": "items"
}
]
}
Self and Index are universal to any Resourcevnd.company.app-version+json
Seriously.
Write it.
Publish it.
Throw your specification on the pile.
"links": { "http://hyperdungeon.com/directions": { "href": "http://hyperdungeon.com/rooms/5", "title": "A small forest" } }
{ "links": { } }
Upsurge in attention over the past 2+ years.
Change will be constant.
Media Types are going to die.
"links": { HTTP Status Codes, RFC 5988 - Rel Types }