Slide 1

Slide 1 text

3&45ͷྗ ܊ࢁতਔ

Slide 2

Slide 2 text

܊ࢁতਔ http://twitter.com/koriym

Slide 3

Slide 3 text


 Hypertext


Slide 4

Slide 4 text

Hypertext ͱ͸ 
 ෳ਺ͷςΩετΛ૬ޓʹؔ࿈෇͚ɺ݁ͼ෇͚Δ࢓૊Έ
 
 http://www.ltrebing.de/studium/hypertext/hypertext.gif https://ja.wikipedia.org/wiki/%E3%83%8F%E3%82%A4%E3%83%91%E3%83%BC%E3%83%86%E3%82%AD%E3%82%B9%E3%83%88

Slide 5

Slide 5 text

Ted Nelson
 Hypertext
 Hypermedia
 
 1963 http://dc-mrg.english.ucsb.edu/conference/CNCSC/multimedia/documents/wardrip-fruin.pdf

Slide 6

Slide 6 text

Douglas Engelbart
 oN-Line System (NLS)
 1968 https://en.wikipedia.org/wiki/The_Mother_of_All_Demos

Slide 7

Slide 7 text

Bill Atkinson
 
 HyperCard 1984 https://en.wikipedia.org/wiki/HyperCard

Slide 8

Slide 8 text

Information Management: A Proposal Tim Berners-Lee, CERN March 1989 WorldWideWeb: Proposal for a HyperText Project T. Berners-Lee/CN, R. Cailliau/ECP November 1990 https://www.w3.org/History/1989/proposal.html https://www.w3.org/Proposal.html

Slide 9

Slide 9 text

Tim Berners-Lee WWW 
 1991 https://www.w3.org/People/Berners-Lee/

Slide 10

Slide 10 text

WWW = Hypertext + Internet https://fukuno.jig.jp/826

Slide 11

Slide 11 text

• HTML • URI • HTTP 


Slide 12

Slide 12 text

https://groups.google.com/d/msg/comp.infosystems.www.authoring.cgi/-/M9FkTUVDfcwJ

Slide 13

Slide 13 text

WebObjects 1996 WebObjects 1996 http://everystevejobsvideo.com/steve-jobs-presents-webobjects-at-mspdc-1996-2/

Slide 14

Slide 14 text

Roy T Fielding REST
 2000 https://www.ics.uci.edu/~fielding/pubs/dissertation/top.htm

Slide 15

Slide 15 text

ΞʔΩςΫνϟελΠϧͱωοτϫʔΫϕʔεͷιϑτ΢ΣΞΞʔΩςΫνϟͷઃܭɻ
 ത࢜࿦จɺΧϦϑΥϧχΞେֶΞʔόΠϯߍɺ2000೥ https://www.ics.uci.edu/~fielding/pubs/dissertation/top.htm

Slide 16

Slide 16 text

http://roy.gbiv.com/untangled/2008/rest-apis-must-be-hypertext-driven 3&45"1*͸ϋΠύʔςΩετۦಈͰ͸ͳ͍ͱ͍͚ͳ ͍ɻ
 ୯ͳΔ)551"1*͕3&45"1*ͱݺ͹ΕͯΔ͜ͱʹϑϥ ετϨʔγϣϯΛײ͡Δɻ

Slide 17

Slide 17 text

•REST API͸ݻఆͷϦιʔε໊΍֊૚Λఆٛͯ͠ ͸ͳΓ·ͤΜɻ… ͦͷ୅ΓʹͲͷΑ͏ʹURIΛ ૊ΈཱͯΔ͔Λࢦࣔ͠·͢ɻ •Ϧιʔεͷදݱ΍ΞϓϦέʔγϣϯঢ়ଶͷۦಈ ʹ࢖༻͞ΕΔϝσΟΞλΠϓͷఆٛɺ·ͨ͸طଘ ͷඪ४ϝσΟΞλΠϓʹର͢Δ֦ுϦϨʔγϣϯ ໊΍ϋΠύʔςΩετରԠϚʔΫΞοϓͷఆٛ ʹɺͦͷهड़తͳ౒ྗͷ΄ͱΜͲ͢΂ͯΛඅ΍ ͢ඞཁ͕͋Γ·͢ http://roy.gbiv.com/untangled/2008/rest-apis-must-be-hypertext-driven

Slide 18

Slide 18 text

https://www.ca.com/content/dam/ca/jp/files/ebook/a-guide-to-rest-and-api-design.pdf

Slide 19

Slide 19 text

https://mooreniemi.github.io/3_models_of_apis/#/fragments

Slide 20

Slide 20 text

શͯͷϞσϧ͸ؒҧ͍ͬͯΔɺ
 ͕ͩதʹ͸໾ཱͭ΋ͷ΋͋Δ
 
 — Box, George E. P. 


Slide 21

Slide 21 text

l3&45GVM63*z

Slide 22

Slide 22 text

http://t-code.pl/blog/2016/02/rest-misconceptions-1/

Slide 23

Slide 23 text

https://stackoverflow.com/questions/6845772/rest-uri-convention-singular-or-plural-name-of-resource-while-creating-it

Slide 24

Slide 24 text

https://youtu.be/pspy1H6A3FM

Slide 25

Slide 25 text

http://t-code.pl/blog/2016/02/rest-misconceptions-1/

Slide 26

Slide 26 text

"1*7FSTJPOJOH

Slide 27

Slide 27 text

https://www.slideshare.net/evolve_conference/201308-fielding-evolve

Slide 28

Slide 28 text

https://www.slideshare.net/evolve_conference/201308-fielding-evolve

Slide 29

Slide 29 text

https://twitter.com/fielding/status/376835835670167552

Slide 30

Slide 30 text

౷ҰΠϯλʔϑΣΠεͱ͸
 )551ϝιουΛ$36%ʹϚοϐϯά͢Δࣄ 
 lϦιʔεʹର͢Δૢ࡞͸ɺʜ̐ͭͷϝιου Λఏڙ͍ͯ͠Δz 2007 https://books.google.co.jp/books?id=-7iMOLUQDqQC&pg=PA200&lpg=PA200&dq=REST+ %22%E7%B5%B1%E4%B8%80%E3%82%A4%E3%83%B3%E3%82%BF%E3%83%BC%E3%83%95%E3%82%A7%E3%82%A4%E3%82%B9%22&source=bl&ots=NIK Kf8qSOQ&sig=ACfU3U1E- lkPNbf9mxDDdfmaEPLUqVg61Q&hl=ja&sa=X&ved=2ahUKEwiuj4Gg7JnhAhUDCqYKHU_4AIgQ6AEwBnoECAgQAQ#v=onepage&q=REST%20%22%E7%B5%B1% E4%B8%80%E3%82%A4%E3%83%B3%E3%82%BF%E3%83%BC%E3%83%95%E3%82%A7%E3%82%A4%E3%82%B9%22&f=false 3&45"1*$36%PWFS)551XJUIQSFUUZ63*

Slide 31

Slide 31 text

REpresentational State Transfer
 
 = Ϧιʔεͷ͜ͱ ͚ͩ͡Όͳ͍ͷ ? https://qiita.com/NagaokaKenichi/items/0f3a55e422d5cc9f1b9c

Slide 32

Slide 32 text

“architectural style for 
 distributed hypermedia systems” https://www.ics.uci.edu/~fielding/pubs/dissertation/introduction.htm

Slide 33

Slide 33 text

3FTPVSDF4UBUF "QQMJDBUJPO4UBUF Ϧιʔεঢ়ଶදݱ
 ࣍ͷΞΫγϣϯ 3FRVFTU w4BGF w6OTBGF Server ΞΫγϣϯ 
 B
 GPSN Client

Slide 34

Slide 34 text

https://www.programmableweb.com/news/how-guardian-approaching-hypermedia-based-api-infrastructure/2015/04/27

Slide 35

Slide 35 text

https://www.slideshare.net/evolve_conference/201308-fielding-evolve

Slide 36

Slide 36 text

https://www.slideshare.net/evolve_conference/201308-fielding-evolve "ΞϓϦέʔγϣϯঢ়ଶΛۦಈ"͢ΔͨΊͷϋΠύʔςΩετ
 = HATAOAS https://www.howtopronounce.com/hateoas/

Slide 37

Slide 37 text

https://www.infoq.com/jp/articles/webber-rest-workflow ༗ݶঢ়ଶػց '4. http://www.comp.tmu.ac.jp/morbier/newcomparch/FSM00.html

Slide 38

Slide 38 text

wΫϥΠΞϯτʗαʔό wεςʔτϨεੑ wΩϟογϡ w֊૚ԽγεςϜ w ίʔυΦϯσϚϯυ w౷ҰΠϯλϑΣʔεɹ ͭͷΠϯλʔϑΣΠε੍໿ʣ wϦιʔεͷࣝผ 63* wදݱʹΑΔϦιʔεૢ࡞ wࣗݾهड़తϝοηʔδ wϋΠύʔϝσΟΞ੍໿ )"5&0"4 3&45ʢ'JFMEJOHʣ੍໿ "38 https://www.ics.uci.edu/~fielding/pubs/dissertation/rest_arch_style.htm

Slide 39

Slide 39 text

https://martinfowler.com/articles/richardsonMaturityModel.html

Slide 40

Slide 40 text

$BDIF RFC7243 https://tools.ietf.org/html/rfc7243

Slide 41

Slide 41 text

l࠷ߴͷΞϓϦέʔγϣϯύϑΥʔϚϯε͸
 ωοτϫʔΫΛ࢖Θͳ͍࣌ʹಘΒΕΔz The best application performance is obtained by not using the network. https://www.ics.uci.edu/~fielding/pubs/dissertation/net_app_arch.htm

Slide 42

Slide 42 text

No content

Slide 43

Slide 43 text

No content

Slide 44

Slide 44 text

https://www.cloudflare.com/learning/cdn/glossary/what-is-cache-control/ $BDIFΛίϯτϩʔϧ͢Δͷ͸αʔόʔ ΩϟογϡΛߦ͏ͷ͸ΫϥΠΞτ

Slide 45

Slide 45 text

Server (&5CPPL
 "DDFQU-BOHVBHF+" + $BDIF$POUSPMFNBYBHF 7BSZ"DDFQU-BOHVBHF (&5CPPL
 "DDFQU-BOHVBHF+" ඵ༗ޮ https://www.slideshare.net/InfoQ/caching-hypermedia-apis

Slide 46

Slide 46 text

৚݅෇͖ϦΫΤετ RFC7232 https://tools.ietf.org/html/rfc7232

Slide 47

Slide 47 text

https://www.slideshare.net/InfoQ/caching-hypermedia-apis/35

Slide 48

Slide 48 text

Cache-Controle: public

Slide 49

Slide 49 text

$ System GET /cat
 Cache-Controle: public,max-age=3600 GET /cat 200 OK

Slide 50

Slide 50 text

Framework
 +
 Application Etag GET /cat ETag: 3 3 batch

Slide 51

Slide 51 text

Cache-Control: 
 max-age=0,
 private, 
 must-revalidate ຊ౰ʹ ? https://.com/recipe/1416377

Slide 52

Slide 52 text

http://bearsunday.github.io/manuals/1.0/ja/http-cache.html

Slide 53

Slide 53 text

guzzle-cache-middleware https://github.com/Kevinrob/guzzle-cache-middleware

Slide 54

Slide 54 text

Ωϟογϡઃܭ w 55-ʢ༧ଌՄೳʣ&5BHʢෆՄ஌ʣ w QVCMJD QSJWBUF w OPDBDIFΩϟογϡར༻ʹඞͣ֬ೝ w OPTUPSFΩϟογϡΛอଘ͠ͳ͍

Slide 55

Slide 55 text

https://developers.google.com/web/fundamentals/performance/optimizing-content-efficiency/http-caching?hl=ja

Slide 56

Slide 56 text

$BDIF

Slide 57

Slide 57 text

ࣗݾهड़తϝοηʔδ )551ϝοηʔδ͸ड৴ऀ͕ཧղ͢ΔͨΊʹඞཁͳ͢΂ͯͷ৘ใΛؚΉ

Slide 58

Slide 58 text

.FEJB5ZQF RFC 6838 https://tools.ietf.org/html/rfc6838

Slide 59

Slide 59 text

• text/html (hypermedia) • application/json • application/hal+json (hypermedia)
 
 • application/problem+json • vnd.amundsen.maze+xml (OFSJD %PNBJOTQFDJpD

Slide 60

Slide 60 text

https://www.iana.org/assignments/media-types/media-types.xhtml

Slide 61

Slide 61 text

https://tools.ietf.org/html/draft-ietf-appsawg-http-problem-03

Slide 62

Slide 62 text

application/prs.koriym.travel+json
 https://tools.ietf.org/html/rfc6838#section-3.3 https://tools.ietf.org/html/rfc6838#section-3.4 application/x.koriym.travel+json Personal or Vanity Tree Unregistered x. Tree

Slide 63

Slide 63 text

rel="profile" RFC 6906 https://tools.ietf.org/html/rfc6906

Slide 64

Slide 64 text

$ curl -i http://example.com 
 HTTP/1.1 200 OK Content-Type: application/json Link: ; rel="profile" { "wtl": "MjAxMy0wNS0wNiAxMjo1Nzo1MyAtMDcwMA==\n", “grobb34s": […] } $ curl -i http://example.com/profile
 HTTP/1.1 200 OK Content-Type: text/plain 
 The Example.com API =================== Example.com provides access to our blog through an API. In the API, you'll see two major things of interest: `wtl` and `grobb34s` ## wtl The value provided under the `wtl` key is the time the latest blog post was posted, in "%Y-%m-%d %H:%M:%S %z" format. This value is then Base64 encoded. http://www.designinghypermediaapis.com/blog/the-profile-link-relation-and-you.html

Slide 65

Slide 65 text

rel="describedby" https://json-schema.org/latest/json-schema-core.html#rfc.section.10.1

Slide 66

Slide 66 text

HTTP/1.1 200 OK
 Content-Type: application/json
 Link: ; rel="describedby" {
 "id": 123,
 “title": “Shopping” 
 } https://json-schema.org/latest/json-schema-core.html

Slide 67

Slide 67 text

UPEPKTPO {
 ”$id”: “http://example.com/todo.json",
 "$schema": "http://json-schema.org/draft-07/schema#",
 "title": "Todo",
 "type": "object",
 "properties": {
 "id": {
 "type": "type": "string",
 "description": "The unique identifier for todo."
 },
 "title": {
 "type": "string",
 "description": "The title of the todo",
 "minLength": 3,
 "maxLength": 255
 }
 }

Slide 68

Slide 68 text

/BNJOH There are only two hard things in Computer Science: cache invalidation and naming things.
 -- Phil Karlton

Slide 69

Slide 69 text

pSTUOBNF pSTU@OBNF pSTU/BNF

Slide 70

Slide 70 text

HJWFO/BNF

Slide 71

Slide 71 text

https://schema.org/Person

Slide 72

Slide 72 text

ϘΩϟϒϥϦ IUUQFYBNQMFDPNNZ@QSPpMF

Slide 73

Slide 73 text

rel = "item" https://www.iana.org/assignments/link-relations/link-relations.xhtml *"/"-JOL3FMBUJPO rel = "collection"

Slide 74

Slide 74 text

.JDSPGPSNBUT-JOL3FMBUJPO rel="friend" http://microformats.org/wiki/existing-rel-values

Slide 75

Slide 75 text

BQQMJDBUJPOMEKTPO https://json-ld.org/spec/latest/json-ld-api-best-practices/

Slide 76

Slide 76 text

+40/-%)ZESB https://sookocheff.com/post/api/on-choosing-a-hypermedia-format/

Slide 77

Slide 77 text

http://gtramontina.com/h-factors/

Slide 78

Slide 78 text

• Φϯτϩδʔ (ҙຯ) • λΫιϊϛʔ (෼ྨ) • ίϨΦάϥϑΟʔ(૬ޓ࡞༻)
 *"

Slide 79

Slide 79 text

ࣗݾهड़తϝοηʔδ

Slide 80

Slide 80 text

•Ϧιʔεͷදݱ΍ΞϓϦέʔγϣϯঢ়ଶͷۦಈ ʹ࢖༻͞ΕΔϝσΟΞλΠϓͷఆٛɺ·ͨ͸طଘ ͷඪ४ϝσΟΞλΠϓʹର͢Δ֦ுϦϨʔγϣϯ ໊΍ϋΠύʔςΩετରԠϚʔΫΞοϓͷఆٛ ʹɺͦͷهड़తͳ౒ྗͷ΄ͱΜͲ͢΂ͯΛඅ΍ ͢ඞཁ͕͋Γ·͢ http://roy.gbiv.com/untangled/2008/rest-apis-must-be-hypertext-driven

Slide 81

Slide 81 text

r3PZ5'JFEMJOH lཧղڞ༗ʹয఺Λ౰ͯΔz GPDVTJOHPOBTIBSFEVOEFSTUBOEJOH

Slide 82

Slide 82 text

.FEJB5ZQF 1SPpMF 4UBUF -JOL 3FTPVSDF SFM SFM TDIFNBPSH *"/" ϚΠϘΩϟϒϥϦ

Slide 83

Slide 83 text

l3&45ͱ͸શͯΛ݁Ϳྗz

Slide 84

Slide 84 text

https://intertwingled.org/jp/ ࢲ͕ͨͪͳʹ͔ΛͻͱͭͱΓ͋͛Α͏ͱ͢Δͱ
 ͦΕ͕·ΘΓͷੈքͷ͢΂ͯͱҾ͔Ε߹͏Α͏ʹ ͭͳ͕͍ͬͯΔ͜ͱʹؾͮ͘ɻ 
 —δϣϯɾϛϡʔΞ

Slide 85

Slide 85 text

Credit: From Nelson, Computer Lib/Dream Machines (Courtesy of Theodor Holm Nelson) ͢΂͕ͯਂ͘ࡨ૰͍ͯ͠Δ https://link.springer.com/chapter/10.1007/978-3-319-16925-5_13

Slide 86

Slide 86 text

Project Xanadu
 1960 - 2014 http://www.xanadu.net/

Slide 87

Slide 87 text

http://xanadu.com/XanaduSpace/btf.htm