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

Rails歴==エンジニア歴の私の学び方 #omotesandorb #37 LT

mikaji
August 02, 2018

Rails歴==エンジニア歴の私の学び方 #omotesandorb #37 LT

#omotesandorb #37 のLT資料です。Railsを書いて3年経ったので自分の学び方を振り返りました。Railsだけでなく何にでも応用できる考え方です。

mikaji

August 02, 2018
Tweet

More Decks by mikaji

Other Decks in Programming

Transcript

  1. Railsྺ==ΤϯδχΞྺ
    ͷࢲͷֶͼํ
    Thu, 02 Aug 2018
    @mikaji #omotesandorb #37

    View full-size slide

  2. ࣗݾ঺հ
    • GitHub: @mikaji
    • Twitter: @mikaji_jp
    • ձࣾ: גࣜձࣾϦΫϧʔτϚʔέςΟϯάύʔτφʔζ ৽ଔ2೥໨
    • Railsྺ: 3೥ (Rails3~5ܥ)
    • ॳ දࢀಓ.rb!!☺
    • ࠷ۙYouTuber΍ͬͯ·͢

    https://www.youtube.com/c/mikaji

    View full-size slide

  3. ΅͘ͱ Ruby RailsͷؔΘΓΛ
    ࿩͠·͢

    View full-size slide

  4. ࿩͢͜ͱ
    • ະܦݧ͔ΒͲ͏ֶΜͰ͍͔ͬͨ
    • ࣮ମݧʹΑΔֶͼํͷྑ͔ͬͨ఺ɾѱ͔ͬͨ఺
    • ࠷ۙͷΩϟονΞοϓํ๏

    View full-size slide

  5. ର৅ऀ
    • WebΞϓϦΛॻ͍ͨ͜ͱ͕ͳ͍ਓ
    • RailsΞϓϦΛॻ͍ͨ͜ͱ͕ͳ͍ਓ
    • ݸਓͰ͸ܦݧ͋Δ͚ͲϓϩδΣΫτͰRailsΞϓ
    Ϧॻ͍ͯͳ͍ਓ

    View full-size slide

  6. ֶੜ࣌୅
    • ৘ใ޻ֶΛઐ߈͍͕ͯͨ͠WebΞϓϦॻ͍ͨ͜
    ͱͳ͍
    • ݚڀࣨͰ͸ϚΠίϯ͍ͬͨ͡Γ౷ܭֶֶΜͩΓ
    • ॻ͍ͯͨݴޠ: C, C++, Java, Scheme, Prolog,
    Haskell, etc…

    Ruby͸ॻ͍ͨ͜ͱͳ͔ͬͨ

    View full-size slide

  7. 1.
    Θ͚͕Θ͔Βͳͯ͘΋
    Rails TutorialΛ
    पճϓϨΠ͢Δ

    View full-size slide

  8. Rails TutorialΛແ৺Ͱ΍Δ
    • MVCͷ໾ׂ͕Θ͔Βͳͯ͘΋΍Δ
    • ηογϣϯ؅ཧ͕Θ͔Βͳͯ͘΋΍Δ
    • ͱʹ͔͘ॻ͘͜ͱ͕େࣄ
    ΅͘͸3प໨Ͱ
    ྗਚ͖·ͨ͠

    View full-size slide

  9. 2. WebΛࢧ͑Δٕज़Λ
    ಡΉ

    View full-size slide

  10. ಡΈ΍໊͍͢͠ஶ
    Ͱ͢

    View full-size slide

  11. WebΛࢧ͑Δٕज़ͷྑ͍ͱ͜Ζ
    • HTTPͷ࢓૊Έ͕Θ͔Δ
    • Railsͱਂ͍ؔ܎ͷRESTͷ֓೦Λ͓͑͞ΒΕΔ
    • RailsͷϦιʔεઃܭͷΠϝʔδ͕͍ͭͯ͘Δ

    View full-size slide

  12. 3. Rails࢖ͬͯΔϓϩδΣ
    ΫτʹೖΔ

    View full-size slide

  13. Rails࢖ͬͯΔϓϩδΣΫτʹೖΔ
    • MVCͷ໾ׂΛҙࣝ͢Δ
    • ActiveRecordʹ৮ΕΔ

    ϩάʹు͔ΕΔΫΤϦͷ૊Έཱͯ΋ோΊΔͱ

    ߹ΘͤͯSQLຊ΋…
    • ଞਓͷίʔυͷॻ͖ํ͕Θ͔Δ

    ʢ͋ΔػೳΛ࡞Γ͍ͨͱ͖Ͳ͏࣮૷͍͔ͯ͘͠ʣ

    View full-size slide

  14. 4. ϝϯλʔΛݟ͚ͭΔ

    View full-size slide

  15. ϝϯλʔ͕େ੾ͳཧ༝
    • ࠓͷࣗ෼͕ཧղͰ͖͍ͯͳ͍ͱ͜Ζ͕Θ͔Δ

    ϨϏϡʔͰϘίϘίʹ͞ΕΔͷ΋ྑ͍ܦݧ
    • ઃܭʹ໎ͬͨͱ͖ٞ࿦Ͱ͖Δ
    • ϖΞϓϩͰ͖Δ

    ΅͘ͷܦݧ্΋ͬͱ΋ޮՌ͕͋Γ·ͨ͠

    View full-size slide

  16. 5. Railsͷ޷͖ͳͱ͜Ζ
    Λݟ͚ͭΔ

    View full-size slide

  17. Railsͷ޷͖ͳͱ͜Ζ
    • ֤ϨΠϠͷ໾ׂ΍͖Ε͍ͳઃܭɺΠϯλϑΣʔεʹڵຯΛ࣋ͭΑ͏ʹ
    ͳͬͨ

    ⏩΋ͬͱ஌Γ͍ͨʂ

    PofEAA΍DDDͷཧղ͕૿͢

    rails newͨ͠ͱ͖ʹੜ੒͞ΕΔ΋ͷҎ֎ͷύλʔϯΛ஌Δ
    (FormObject, ServiceObject …) ৄ͘͠͸#railsdmͰLTͨ͠ࢿྉΛ…ʂ
    • Ͳ͜Ͱ΋ྑ͍ͷͰ޷͖ͳ෦෼Λݟ͚ͭΔͱ͙ͬͱֶͼ͕
    ਂ͘ͳΓ·͢

    View full-size slide

  18. 6. ࠷৽ͷRailsΛ௥͏

    View full-size slide

  19. ෼ใʹຖ೔ϙετ͞ΕΔ

    View full-size slide

  20. ࠷ۙͷΩϟονΞοϓํ๏
    • ϠΪψϚ৽ฉΛಡΉ (#railsdmͰऔΓೖΕͨ)

    ຖ೔slackʹྲྀͯ͠࢓ࣄલͷ೔՝ʹ͍ͯ͠·͢
    • RailsͷϦϙδτϦ಺ͷissue௥͑ΔͱϕλʔʢͰ͖
    ͯͳ͍ʣ
    • ࠷ॳ͸࢖ͬͯΔgemͷιʔείʔυோΊΔͰ΋ྑ͍
    ͱࢥ͍·͢(OSSʹ΋ͭͳ͕Γ·͢)

    View full-size slide

  21. ·ͱΊ
    • ॳΊ͸ͱʹ͔͘ॻ͖·͠ΐ͏
    • ଞਓΛר͖ࠐΈ·͠ΐ͏ʢϝϯλʔɺษڧձͰ
    ൃදʣ
    • ৗʹมԽʹରԠ͍͖ͯ͠·͠ΐ͏

    View full-size slide