JavaエンジニアからみたVapor

33f6da3f9e2530fff68c72e33f313839?s=47 kissybnts
November 21, 2017

 JavaエンジニアからみたVapor

Swift/Kotlin合同勉強会 #2のLT資料です

33f6da3f9e2530fff68c72e33f313839?s=128

kissybnts

November 21, 2017
Tweet

Transcript

  1. +BWBΤϯδχΞ͔ΒΈͨ Vapor

  2. Name: Kishida @KissyBnts Company: Monstar Lab, Inc. Role: Server side

    engineer, Bridge engineer Language: Java, Kotlin, TypeScript
  3. What is Vapor?

  4. None
  5. None
  6. None
  7. None
  8. None
  9. 

  10. +BWBΤϯδχΞ͔ΒΈͨ Vapor

  11. ͞ΘͬͯΈΑ͏ͱࢥͬͯ΋Β͏͜ͱΛ໨ඪʹ

  12. w ؀ڥߏங͕؆୯ w Ұ௨Γͷػೳ͕ἧ͍ͬͯͯ௥Ճ͕؆୯ w υΩϡϝϯτ͕๛෋ͰεϚʔτ w ׂͱ 03.͕࢖͍΍͍͢

  13. w ؀ڥߏங͕؆୯ w Ұ௨Γͷػೳ͕ἧ͍ͬͯͯ௥Ճ͕؆୯ w υΩϡϝϯτ͕๛෋ͰεϚʔτ w ׂͱ 03.͕࢖͍΍͍͢

  14. None
  15. 1. $ grade init - -type java-application 2. Getting startedʹԊͬͯdependenciesΛ௥Ճ

    3. ίʔυΛॻ͘ 4. Run
  16. Vapor Toolbox

  17. $ vapor new <name> - -template=<template name> $ cd <name>

    $ vapor run template list https://github.com/search?utf8=%E2%9C%93&q=topic%3Avapor+topic%3Atemplate&type=Repositories
  18. $ vapor xcode -y

  19. w ؀ڥߏங͕؆୯ w Ұ௨Γͷػೳ͕ἧ͍ͬͯͯ௥Ճ͕؆୯ w υΩϡϝϯτ͕๛෋ͰεϚʔτ w ׂͱ 03.͕࢖͍΍͍͢

  20. None
  21. None
  22. None
  23. None
  24. w ؀ڥߏங͕؆୯ w Ұ௨Γͷػೳ͕ἧ͍ͬͯͯ௥Ճ͕؆୯ w υΩϡϝϯτ͕๛෋ͰεϚʔτ w ׂͱ 03.͕࢖͍΍͍͢

  25. w ؀ڥߏங͕؆୯ w Ұ௨Γͷػೳ͕ἧ͍ͬͯͯ௥Ճ͕؆୯ w υΩϡϝϯτ͕๛෋ͰεϚʔτ w ׂͱ 03.͕࢖͍΍͔ͬͨ͢ w

    ؀ڥߏங͕؆୯ w Ұ௨Γͷػೳ͕ἧ͍ͬͯͯ௥Ճ͕؆୯ w υΩϡϝϯτ͕๛෋ͰεϚʔτ w 7FSTJPOͰ݁ߏมΘΔΈ͍ͨ
  26. JPA? Hibernate?

  27. JPA? Hibernate? ࢓༷͕Θ͔Γʹ͍͘ େྔͷΞϊςʔγϣϯ ܹ஗ΫΤϦΛൃߦ

  28. MyBatis? Doma2? jooq? requery?

  29. MyBatis? Doma2? jooq? requery? ,PUMJOͰॻ͘ͱቕΔ ࣗಈίʔυੜ੒ʹ,BQUͰቕΔ 9.-ʹॻ͔ͳ͍ͱ͍͚ͳ͍

  30. Fluent

  31. w ཧղ͠΍͍͢ w ίʔυΛࣗಈੜ੒͠ͳ͍ w ϚΠάϨʔγϣϯ΋Ͱ͖Δ w 2VFSZCVJMEJOH΋Ͱ͖Δ

  32. final class User : Model { var name: String var

    age: Int init(name: String, age: Int) { self.name = name self.age = age } init(row: Row) throws { name = try row.get(“name”) age = try row.get(“age”) } func makeRow() throws -> Row { var row = Row() try row.set(“name”, name) try row.set(“age”, age) return row } }
  33. let user = User(“Kishida”, 25) try user.save() try user.delete() try

    User.makeQuery() .filter(“age”, 20) .sort(“id”, .ascending) .all()
  34. w ଎͍ Β͍͠  w 9DPEFͰ։ൃͰ͖Δ w 7BQPS5PPMCPYͰ)FSPLV 7BQPSDMPVEʹ%FQMPZͰ͖Δ w

    ެࣜͷ4MBDLͰ࣭໰Ͱ͖Δ w FUD ΄͔ʹ΋
  35. Server sideΛ࢝ΊΔͷʹ࠷ద ݁࿦

  36. Kotlinʹ͜͏͍͏ϑϨʔϜϫʔΫ͕ཉ͍͠ ݁࿦

  37. KotlinΤϯδχΞ͕࢝ΊΔཧ༝͸ɾɾɾ

  38. ݱঢ়ͳ͍

  39. w Kotlinͱ͍͏͔Java͸Server sideͰಈ͘ w JavaͷFramework͕KotlinΛެࣜαϙʔτ w JetBrainsͷIDEΛ࢖͑Δ w Xcode׳Εͳ͍

  40. Ͱ΋Kotlin੡ͷFramework͕͍͍

  41. x Exposed / Squash

  42. એ఻

  43. 2018/01/๭೔ʹVapor meetup͢ΔΈ͍ͨͰ͢ $POUSJCVUPSͷ5BOOFSͱ͔-PHBO΋དྷΔ͔΋ʁ