Upgrade to Pro — share decks privately, control downloads, hide ads and more …

モバイルアプリとAPIのありかたを考える2014

ar_tama
August 30, 2014

 モバイルアプリとAPIのありかたを考える2014

YAPC::Asia 2014

ar_tama

August 30, 2014
Tweet

More Decks by ar_tama

Other Decks in Programming

Transcript

  1. Copyright (C) 2013 DeNA Co.,Ltd. All Rights Reserved. ΠϯτϩμΫγϣϯ 3

    • ͋Βͨ· • !BS@UBNB • גࣜձࣾσΟʔɾΤψɾΤʔ • γεςϜຊ෦ϓϥοτϑΥʔϜγεςϜ෦αʔόʔάϧʔϓ • ࣗࣾϓϥοτϑΥʔϜͷΊΜͲ͏ΛݟΔͱ͜Ζ
  2. Copyright (C) 2013 DeNA Co.,Ltd. All Rights Reserved. ΠϯτϩμΫγϣϯ 4

    • झຯͰJ04ΞϓϦΛ͍ͭͬͯ͘·͢ • IUUQUFOTVOFU
  3. Copyright (C) 2013 DeNA Co.,Ltd. All Rights Reserved. ࣭໰Ͱ͢ 8

    • αʔόαΠυΤϯδχΞͩΑʔ • ΫϥΠΞϯταΠυΤϯδχΞͩΑʔ • Ͳͬͪ΋΍ΔΑʔ
  4. Copyright (C) 2013 DeNA Co.,Ltd. All Rights Reserved. ຊฤʹೖΔ·͑ʹʜ 9

    • ͜ΜͳͻͱΛର৅ʹ͍ͯ͠·͢ • ΫϥΠΞϯταΠυΤϯδχΞ͚ͩͲɺαʔόαΠυ ͱΤϯδχΞ ͷ ͜ͱΛ΋ͬͱ஌Γ͍ͨ • αʔόαΠυΤϯδχΞ͚ͩͲɺΫϥΠΞϯταΠυ ͱΤϯδχΞ ͷ ͜ͱΛ΋ͬͱ஌Γ͍ͨ • ϞόΠϧΞϓϦؔ࿈ͷτϐοΫʹڵຯ͕͋Δ • ϞόΠϧΞϓϦ։ൃΛ΋ͬͱΑ͍ͨ͘͠ • ݰਓʹ͸෺଍Γͳ͍͔΋ʂ
  5. Copyright (C) 2013 DeNA Co.,Ltd. All Rights Reserved. ຊฤʹೖΔ·͑ʹʜ 10

    • ʮϞόΠϧΞϓϦʯͷఆٛ • ͓΋ʹJ04"OESPJEΞϓϦΛࢦͯ͠࢖͍ͬͯ·͢ • ΫϥΠΞϯταΠυͷࣄྫ΍σϞͱͯ͠ڍ͛Δͷ͸J04ͷΈ
  6. Copyright (C) 2013 DeNA Co.,Ltd. All Rights Reserved. ϞόΠϧΞϓϦ͋Δ͋Δ 11

    • খ͘͞ग़ͯ͠ίπίπվળ͕΍Γʹ͍͘ͱ͔ • WJFX෦෼ͷHJU؅ཧͭΒ͍ͱ͔ • αΠζ੍ݶ͍ͨ΁Μͱ͔ • σόΠεؒಉظ͋ͨΓ·͑ͩΑͶͱ͔ • ௨৴ͱ͔
  7. Copyright (C) 2013 DeNA Co.,Ltd. All Rights Reserved. ϞόΠϧΞϓϦ͋Δ͋Δ 12

    • খ͘͞ग़ͯ͠ίπίπվળ͕΍Γʹ͍͘ͱ͔ • WJFX෦෼ͷHJU؅ཧͭΒ͍ͱ͔ • αΠζ੍ݶ͍ͨ΁Μͱ͔ • σόΠεؒಉظ͋ͨΓ·͑ͩΑͶͱ͔ • ௨৴ͱ͔
  8. Copyright (C) 2013 DeNA Co.,Ltd. All Rights Reserved. ϞόΠϧΞϓϦ͋Δ͋Δ 14

    • ਓࡐෆ଍ͰͨͲͨͲ͘͠όοΫΤϯυΛ࡞͍ͬͯͨΒϘτϧωοΫʹʜ • ݸਓɾখதن໛։ൃʹ͋Γ͕ͪ
  9. Copyright (C) 2013 DeNA Co.,Ltd. All Rights Reserved. ϞόΠϧΞϓϦ͋Δ͋Δ 15

    • ຖճΞϓϦΛ࡞ΔͨͼτʔΫϯอଘ΍σʔλಉظ͘Β͍͔͠͠ͳ͍όοΫ ΤϯυΛ࡞͍ͬͯΔ • ͱ͸͍͑࢓༷͕ͪΐͬ͜ͱҧͬͨΓͯ͠ڞ௨Խͮ͠Β͍ • PSڞ௨ԽͰ͖Δ͘͠Έʹͳ͍ͬͯͳ͍
  10. Copyright (C) 2013 DeNA Co.,Ltd. All Rights Reserved. ཧ૝ 17

    • γεςϜ౎߹Ϣʔβ౎߹ • Ϣʔβͷಈ͖ΛγεςϜతͳ౎߹ͰϒϩοΫ͢Δ΂͖Ͱ͸ͳ͍ • ૹ৴தΫϧΫϧͱ͔ • ϢʔβମݧΛ࠷େԽ͢ΔͨΊͷγεςϜΞʔΩςΫνϟͰ͋Γ͍ͨ
  11. Copyright (C) 2013 DeNA Co.,Ltd. All Rights Reserved. .#BB4 20

    • .PCJMF#BDLFOEBTB4FSWJDF • ୅ද֨ͷ1BSTFͱ͍͏αʔϏεʹ͍ͭͯ͢͜͠۷ΓԼ͛·͢
  12. Copyright (C) 2013 DeNA Co.,Ltd. All Rights Reserved. 1BSTF 22

    • σʔλετΞ • 4%,ͱ3&45"1*ͷఏڙ • ϓογϡ௨஌ૹ৴ • ղੳ • ΢ΣϒΞϓϦͷϗεςΟϯά • SEQBSUZQMVHJOTͷಋೖࢧԉ • "QQ-JOLTͱ͔
  13. Copyright (C) 2013 DeNA Co.,Ltd. All Rights Reserved. 1BSTF 23

    • .#BB4 1BB4ͳΠϝʔδ • Ұ෦ͷػೳ͸)FSPLVͬΆ͍ • ͦ͏͍͑͹)FMJPT͍ͬͯ·ʜʁ
  14. Copyright (C) 2013 DeNA Co.,Ltd. All Rights Reserved. 1BSTF 24

    • σʔλετΞ • 4%,ͱ3&45"1*ͷఏڙ • ϓογϡ௨஌ૹ৴ • ղੳ • ΢ΣϒΞϓϦͷϗεςΟϯά • SEQBSUZQMVHJOTͷಋೖࢧԉ • "QQ-JOLTͱ͔
  15. Copyright (C) 2013 DeNA Co.,Ltd. All Rights Reserved. 1BSTF 25

    • ͜Μͳͱ͖ʹ͋͠Θͤ!ΫϥΠΞϯταΠυ • খதن໛ΞϓϦͷϓϩτλΠϐϯάͱεϞʔϧελʔτ • UPLFOͷอଘ΍σʔλͷಉظͷͨΊ͚ͩʹόοΫΤϯυΛ༻ҙ͠ͳͯ͘Α͘ͳΔ • ΞϓϦͦͷ΋ͷͷ։ൃʹूதͰ͖Δ • ˠ1BSTFͷͶΒ͍Ͳ͓Γʂ
  16. Copyright (C) 2013 DeNA Co.,Ltd. All Rights Reserved. 1BSTF 26

    • ͜Μͳͱ͖ʹ͋͠Θͤ!ΫϥΠΞϯταΠυɾαʔόαΠυ • ϞόΠϧΞϓϦɾ΢ΣϒΞϓϦͰͬ͘͞ͱσʔλಉظ • 4%,ͷ෯͕޿͍3&45"1*΋ఏڙ͞Ε͍ͯΔͷͰ൚༻ੑ͕ߴ͍ • 3&45"1*ͷϢʔβ֦ு΋Ͱ͖Δ
  17. Copyright (C) 2013 DeNA Co.,Ltd. All Rights Reserved. ͪΐͬͱدΓಓ 28

    • %SPQCPY%BUBTUPSF"1* • ΦϑϥΠϯͰ$36%ͨ͠%SPQCPY಺ͷσʔλΛΦϯϥΠϯʹͳͬͨλ ΠϛϯάͰΑ͠ͳʹಉظͯ͘͠ΕΔ܅ • ϢʔεέʔεʹΑͬͯ͸ΊͪΌΊͪΌศརͳΑ͔Μʂ
  18. Copyright (C) 2013 DeNA Co.,Ltd. All Rights Reserved. ͜͜Ͱ͓͞Β͍ 29

    • γεςϜ౎߹Ϣʔβ౎߹ • Ϣʔβͷಈ͖ΛγεςϜతͳ౎߹ͰϒϩοΫ͢Δ΂͖Ͱ͸ͳ͍ • ૹ৴தͱ͔ • ϢʔβମݧΛ࠷େԽ͢ΔͨΊͷγεςϜΞʔΩςΫνϟͰ͋Γ͍ͨ
  19. Copyright (C) 2013 DeNA Co.,Ltd. All Rights Reserved. ϏϑΥʔΞϑλʔ 30

    • ϢʔβମݧΛ࠷େԽ͢ΔͨΊͷγεςϜΞʔΩςΫνϟͰ͋Γ͍ͨ • αʔϏεɾϓϩμΫτͦͷ΋ͷʹϑΥʔΧεͰ͖Δ؀ڥ͕੔͍ͭͭ͋Δ
  20. Copyright (C) 2013 DeNA Co.,Ltd. All Rights Reserved. +40/31$ 32

    • +40/Ͱ31$͢ΔͨΊͷ࢓༷ • +40/ܗࣜͰΓ΋ʔͱͳ΀Ζ͠ʔ͡ΌΛ͜ʔΔ͢Δ
  21. Copyright (C) 2013 DeNA Co.,Ltd. All Rights Reserved. +40/31$ 33

    • ʮͨͩ+40/ܗࣜͰϝοηʔδΛ΍ΓͱΓ͢Δ͚ͩͳͷʹԿ͕ͦΜͳʹ͏ Ε͍͠ͷʁʯ
  22. Copyright (C) 2013 DeNA Co.,Ltd. All Rights Reserved. +40/31$ 34

    • ಛ௃ • جຊతʹ1045ͷΈ • 63*͸ͻͱͭʢݺͼग़͢ॲཧ͸1045ύϥϝʔλͰఆٛʣ
  23. Copyright (C) 2013 DeNA Co.,Ltd. All Rights Reserved. +40/31$#BUDI 36

    • Ͱ৽͘͠௥Ճ͞Εͨ࢓༷ • /PUJpDBUJPOͱ#BUDI
  24. Copyright (C) 2013 DeNA Co.,Ltd. All Rights Reserved. +40/31$#BUDI 37

    • ඪ४తͳSFRSFTͷྫ • ௨৴ͱϦΫΤετ͕ client server connec+on req res connec+on req res connec+on req res
  25. Copyright (C) 2013 DeNA Co.,Ltd. All Rights Reserved. +40/31$#BUDI 38

    • +40/31$#BUDISFRSFTͷྫ • ௨৴ͱϦΫΤετ͕O client server connec+on req res
  26. Copyright (C) 2013 DeNA Co.,Ltd. All Rights Reserved. +40/31$#BUDI 39

    • ͜Μͳͱ͖ʹ͋͠Θͤ!ΫϥΠΞϯταΠυ • Ұ౓ʹͨ͘͞ΜϦΫΤετΛૹΓ͍ͨλΠϛϯά • ෼ੳͷͨΊͷϢʔβͷૢ࡞ϩάΛ͹͠͹͠ૹΓ͚͍ͭͨͳͲ
  27. Copyright (C) 2013 DeNA Co.,Ltd. All Rights Reserved. +40/31$#BUDI 40

    • ͜Μͳͱ͖ʹ͋͠Θͤ!ΫϥΠΞϯταΠυ • ෳ਺ͷॲཧΛ૊Έཱͯ΍͍͢ɾίʔυͷ࠶ར༻ੑ͕ߴ·Δ • ରԠ͢ΔॲཧΛಠཱͤͯ͞ॻ͍͓͍ͯͯɺϦΫΤετΛ૊ΈཱͯΔ A B C A C req res
  28. Copyright (C) 2013 DeNA Co.,Ltd. All Rights Reserved. +40/31$#BUDI 41

    • ͜Μͳͱ͖ʹ͋͠Θͤ!αʔόαΠυ • ෳ਺ͷॲཧΛ૊Έཱͯ΍͍͢ • ʮ"ͱ#Λ͢ΔΤϯυϙΠϯτʯʮ"ͱ#ͱ$Λ͢ΔΤϯυϙΠϯτʯͳΜͯ෼͚ ͯఏڙ͠ͳͯ͘Α͘ͳΔ POST  /xxx A,  B POST  /yyy A,  B,  C [{method:  “A”}, {method:  “B”}, {method:  “C”}] A B C
  29. Copyright (C) 2013 DeNA Co.,Ltd. All Rights Reserved. +40/31$#BUDI 42

    • ͜Μͳͱ͖ʹ͋͠Θͤ!Ϣʔβ • ෳ਺SFRSFTΛ·ͱΊͯૹΕΔ͔Βɺ௨৴ίετ͕Լ͕Δ • όοΫΤϯυଆͰॏͨ͗͢Δॲཧ͕૸ΔϦΫΤετΛࠞͥͳ͍ͳͲɺ౰વ޻෉ ͸ඞཁͳ΋ͷͷɺମײ࣌ؒ͸͙ͬͱ୹͘ͳΔ͸ͣʂ
  30. Copyright (C) 2013 DeNA Co.,Ltd. All Rights Reserved. +40/31$#BUDI 43

    • ֤ݴޠͷ࣮૷ঢ়گ • +40/31$ͦͷ΋ͷͷ$MJFOU4FSWFS࣮૷͸ଟ͍΋ͷͷɺ#BUDIʹ ରԠ͍ͯ͠ͳ͍΋ͷ͕ଟ͍ • J04ͷ௨৴ϥΠϒϥϦ୅ද֨"'/FUXPSLJOH ͱɺ"'+40/31$$MJFOU ΋ #BUDIʹରԠ͍ͯ͠ͳ͍ • ࢀߟIUUQFOXJLJQFEJBPSHXJLJ+40/31$*NQMFNFOUBUJPOT
  31. Copyright (C) 2013 DeNA Co.,Ltd. All Rights Reserved. νϥγϧ 45

    • ؔ౦ݍͷεʔύʔͷνϥγ৘ใ͔Β ಛച৘ใͷνΣοΫ΍͓ͶͩΜͷൺֱ͕Ͱ͖ͪΌ͏ΞϓϦ
  32. Copyright (C) 2013 DeNA Co.,Ltd. All Rights Reserved. νϥγϧ 46

    ʊਓਓਓਓਓਓਓʊ ʼɹಥવͷએ఻ɹʻ ʉ:?:?:?:?:?:ʉ
  33. Copyright (C) 2013 DeNA Co.,Ltd. All Rights Reserved. νϥγϧ 47

    • +30/31$#BUDIΛ࢖ͬͯαʔόαΠυͱ΍ΓͱΓ͍ͯ͠Δ • $34+40/31$$MJFOUCZ!TJOUBSJP
  34. Copyright (C) 2013 DeNA Co.,Ltd. All Rights Reserved. $34+40/31$$MJFOU 48

    • +40/31$#BUDIʹରԠͨ͠"1*$MJFOU • ϦΫΤετͦͷ΋ͷͱରԠ͢Δ3FRVFTU*%ͷ࠾൪ɺ؅ཧ • "'/FUXPSLJOHͷ͏͑ʹ৐͔͍ͬͬͯ·͢ • /463-4FTTJPOϕʔε • J04Ή͚ʹ/463-$POOFDUJPOϕʔε΋͋ΔΑʂ
  35. Copyright (C) 2013 DeNA Co.,Ltd. All Rights Reserved. $34+40/31$$MJFOU 49

    • HJUIVCDPNʹͯۙ೔ެ։༧ఆʂ • 'PSL*U
  36. Copyright (C) 2013 DeNA Co.,Ltd. All Rights Reserved. ͜͜Ͱ͓͞Β͍ 51

    • γεςϜ౎߹Ϣʔβ౎߹ • Ϣʔβͷಈ͖ΛγεςϜతͳ౎߹ͰϒϩοΫ͢Δ΂͖Ͱ͸ͳ͍ • ૹ৴தͱ͔ • ϢʔβମݧΛ࠷େԽ͢ΔͨΊͷγεςϜΞʔΩςΫνϟͰ͋Γ͍ͨ
  37. Copyright (C) 2013 DeNA Co.,Ltd. All Rights Reserved. ϏϑΥʔΞϑλʔ 52

    • Ϣʔβͷಈ͖ΛγεςϜతͳ౎߹ͰϒϩοΫ͢Δ΂͖Ͱ͸ͳ͍ • #BUDI3FRVFTUʹΑΔSFRSFTͷߴ଎Խ
  38. Copyright (C) 2013 DeNA Co.,Ltd. All Rights Reserved. ϏϑΥʔΞϑλʔ 53

    • Ϣʔβͷಈ͖ΛγεςϜతͳ౎߹ͰϒϩοΫ͢Δ΂͖Ͱ͸ͳ͍ • #BUDI3FRVFTUʹΑΔSFRSFTͷߴ଎Խ • ϢʔβମݧΛ࠷େԽ͢ΔͨΊͷγεςϜΞʔΩςΫνϟͰ͋Γ͍ͨ • αʔϏεɾϓϩμΫτͦͷ΋ͷʹϑΥʔΧεͰ͖Δ؀ڥ͕੔͍ͭͭ͋Δ
  39. Copyright (C) 2013 DeNA Co.,Ltd. All Rights Reserved. ϏϑΥʔΞϑλʔ 54

    • ʮϢʔβͷͨΊͷཧ૝ʯʹۙͮ͘؀ڥ͸੔͍ͭͭ͋Δ
  40. Copyright (C) 2013 DeNA Co.,Ltd. All Rights Reserved. ࠓ೔Ͱ͖ͳ͔͓ͬͨ͸ͳ͠ 55

    • QSPTDPOTͰ͍͏ͱ͜ΖͷDPOTͷ͓͸ͳ͠ • .#BB4ಋೖ࣌ͷݒ೦ • αʔϏε͕ؒʹͻͱͭ͸͞·Δ͝ͱʹɺͦΕʹҾ͖ͣΒΕΔϦεΫ͕ੜ͡Δ • ͓ͻͬ͜͠͸ʁ • #BUDI3FRVFTUΛ࢖͏΂͖Ͱͳ͍έʔε • αʔόαΠυଆͰ΍ͨΒॏ͍ͨॲཧΛڬΉඞཁ͕͋Δͱ͔ • TJOUBSJPࢯʮΫϥΠΞϯταΠυɾαʔόαΠυͱີʹ࿈ܞͰ͖Δͱ͖ʹ࢖Θͳ ͍ͱ͜Θ͍ΑͶʜʯ