Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Octocatは技術的負債の夢を見るか?
Search
Hiroaki Ninomiya
July 13, 2018
Technology
0
93
Octocatは技術的負債の夢を見るか?
2018/07/13
Rails Developers Meetup 2018 Day 3 Extreme
https://techplay.jp/event/679666
Hiroaki Ninomiya
July 13, 2018
Tweet
Share
More Decks by Hiroaki Ninomiya
See All by Hiroaki Ninomiya
渋谷アジャイルコミュニティへの想い #shibuyagile
treby
0
280
久々にコードを書いてOmniauthでハマった話
treby
0
930
IM@Study活動紹介
treby
1
490
全ての雑用を、生まれる前に消し去りたい
treby
0
450
Webエンジニアからデータエンジニアへ転向している話 #pronama
treby
0
340
Rails 6.0の気になった新機能 #shuuumai
treby
1
660
Shinjuku.rbの移り変わりについて、あるいは大規模カンファレンスの知見を募集したい話 #tqrk13
treby
1
140
EMの悩みにフォーカスする #em_izakaya
treby
0
530
この先生きのこるためのエンジニアキャリア戦略パターン #em_meetup
treby
5
2.4k
Other Decks in Technology
See All in Technology
歴史と背景から改めて振り返るVPC
shotashiratori
2
220
エンジニア採用ノウハウ0から継続的な採用に至るまで / Try recruiting engineers
ohageeq
0
130
Dojo 20240830 COBOL to Java on Z
ichikawayasuhisa
0
240
AWSを始めた頃に陥りがちなポイントをまとめてみた
oshanqq
1
2k
HolidayJp.jl を作りました
mrkn
0
110
分野に潜むツールの紹介
pojiro
1
330
Binary Authorizationと友達になろう / Let's be friends with Binary Authorization
iselegant
2
130
Azure SQL Database Hyperscale HA レプリカの監視
sansantech
PRO
0
190
サイボウズ 開発本部採用ピッチ / Cybozu Engineer Recruit
cybozuinsideout
PRO
9
41k
CRTO/CRTL/OSEPの比較・勉強法とAV/EDRの検知実験
chayakonanaika
0
370
Evolving DevOps Teams and Flexible Organizational Culture
kakehashi
1
140
FastConnect の冗長性
ocise
0
7.1k
Featured
See All Featured
ParisWeb 2013: Learning to Love: Crash Course in Emotional UX Design
dotmariusz
109
6.9k
The Cost Of JavaScript in 2023
addyosmani
39
5.1k
The Cult of Friendly URLs
andyhume
76
5.9k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
28
2.2k
Statistics for Hackers
jakevdp
793
220k
Building Your Own Lightsaber
phodgson
101
5.9k
Embracing the Ebb and Flow
colly
83
4.4k
Learning to Love Humans: Emotional Interface Design
aarron
270
40k
Automating Front-end Workflow
addyosmani
1365
200k
Optimizing for Happiness
mojombo
375
69k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
122
18k
Docker and Python
trallard
39
3k
Transcript
Octocatٕज़తෛ࠴ͷເΛ ݟΔ͔? 2018/07/13 @treby006 Rails Developers Meetup Day3
ࣗݾհ • treby (@treby006) Shinjuku.rb • Reproגࣜձࣾ Dev2νʔϜϦʔμʔ • RailsͰ৽͍͠ػೳΛ࡞ͬͨΓɺطଘػೳͷ
վળͨ͠Γ͍ͯ͠Δͱ͜Ζ • Rails, Vue.js, AWS(ECS, EMR), Go
ReproͷϦϙδτϦ • Railsͷίʔυϕʔε • Πϯϑϥίʔυཧ • ӡ༻εΫϦϓτྨ • ͳͲͳͲ
ReproͷϦϙδτϦ • Railsͷίʔυϕʔε • Πϯϑϥίʔυཧ • ӡ༻εΫϦϓτྨ • ͳͲͳͲ
աڈҰؒͷCommit 2Ґ
աڈҰؒͷAdditions/Deletions 1Ґ (͔ΓͮΒ͍υϠϦϯά)
ReproͷϦϙδτϦ • Railsͷίʔυϕʔε • Πϯϑϥίʔυཧ • ӡ༻εΫϦϓτྨ • ͳͲͳͲ •
େମ CTOͷਓ͕Contribute্Ґ ʹ͍ΔϠόΠ
Reproͷ͝հ
We are hiring!! • ΞϐʔϧϙΠϯτ • େنσʔλ / B to
B ͳΒͰͷݻ͞ • َͷΑ͏ʹίʔυ͕ॻ͚Δ • ఆ࣌ͷ֓೦͕ͳ͍ • ࣗ༝ʗϦϞʔτϫʔΫࣗ༝ • Conferenceνέοτ͕ग़Δ
ͳʹͱͧͳʹͱͧ
ຊ: ٕज़తෛ࠴
ٕज़తෛ࠴ͱ ٕज़తෛ࠴ʢӳ: Technical debtʣͱɺߦ͖ ͨΓͬͨΓͳιϑτΣΞΞʔΩςΫνϟͱɺ ༨༟ͷͳ͍ιϑτΣΞ։ൃ͕Ҿ͖ى݁͜͢Ռͷ ͜ͱΛࢦ͢৽͍͠ൺᄻͰ͋Δ ʮઃܭ্ͷෛ࠴(design debt)ʯͱݴ͏ɻ ----
Wikipediaʮٕज़తෛ࠴ʯΑΓ
Կؾͳ͘͏༻ޠ͚ͩͲ • ࣮ͦͷ࣮ମΛ௫Έ͖Ε͍ͯͳ͍ • ΤϯδχΞʮ͋ʔͳΔ΄ͲͶʯ • ҰํɺϏδωε্ͷϦεΫ͕͔ΓͮΒ͍ • ٕज़తෛ࠴Λ͡Δલʹٕज़తෛ࠴ΛΒͳ͚ ΕͳΒͳ͍
ཧͯ͠Έͨ
ཧͯ͠Έͨ
ٕज़తෛ࠴ • ݏͩɺͳ͍ͨ͘͠ • ଟ͖ͳਓ͍ͳ͍
ٕज़తෛ࠴ • ݏͩɺͳ͍ͨ͘͠ • ଟ͖ͳਓ͍ͳ͍ • ͳͥʁ => ͕͋Δ͔Β •
ͲΜͳʁ
ٕज़తෛ࠴ʹΑΔฐ • ੬͍ઃܭ • อकੑͷԼ • ϞνϕʔγϣϯͷԼ(։ൃޮͷԼ) • νʔϜͷ݈߁ੑͷԼ •
৬ɾ࠾༻ • ࣄۀͷࣦഊ
ٕज़తෛ࠴ͱݺΕΔͷ • छྨ • ͍ΘΏΔΫιίʔυ • εέʔϧ͠ͳ͍ΞʔΩςΫνϟ • ͜͜·Ͱམͱͤ۩ମྫΛ૾͍͢͠ •
ࠓճɺಛʹίʔυ࣮ʹϑΥʔΧε
Ξϯνύλʔϯ(Railsฤ)
έʔε1 ಠࣗDSL/ϑϨʔϜϫʔΫΛΞϓϦέʔγϣϯίʔ υʹೖΕΔ class SomeDSL def self.configulation(*args) end module Definition
def provide(&definition) end end : : end
ಠࣗDSL/ϑϨʔϜϫʔΫΛΞϓϦέ ʔγϣϯίʔυʹೖΕΔ • 0 → 1ͷϑΣʔζͰΓ͕ͪ • େόάϑΟΫεػೳՃͷϫʔΫΞϥϯ υ͕ੵΈॏͳͬͯݟ௨͠ѱ͘ͳΔ •
ͦͷ෦͕ຊʹރΕ͍ͯΕʹͳΒ ͳ͍͜ͱ͋Δ͕……
ಠࣗDSL/ϑϨʔϜϫʔΫΛΞϓϦέ ʔγϣϯίʔυʹೖΕΔ • ։ൃऀ͕ࣗखΛೖΕ͍͢ͷ͕·͍ͣ • ͦͷ࣌୲͍ͯ͠Δػೳ։ൃϕʔεͰमਖ਼Ͱ ͖Δ • ॳ͋ͬͨͣͷDSL/ϑϨʔϜϫʔΫͷࢥ ͕յΕΔ
ಠࣗDSL/ϑϨʔϜϫʔΫΛΞϓϦέ ʔγϣϯίʔυʹೖΕΔ • ָ͍͠RubyͱͷτϨʔυΦϑ • ॻ͖ͨ͘ͳΔ͚ͲνʔϜ։ൃͰ߇͑ͨ΄ ͏͕ແ • gemͱͯ͠OSSެ։ͷํ͕݈શ
έʔε2 ͕ᐆດͳΛऔΓೖΕͯ͠·͏ class SomeController < ApplicationController : : def create
@presenter = SomePresenter.new(@some_model) if @presenter.save redirect_to :some_path else render :new end end end
έʔε2 class SomePresenter < PresenterBase attr_reader :form delegate :save, to:
:form def initialize(some_model) @form = SomeForm.new(some_model.attributes, self) end : : end
έʔε2 class SomeForm < FormBase validate :something : : def
initialize(params) : : end end
͕ᐆດͳΫϥεΛऔΓೖΕͯ͠· ͏ • ͍ΘΏΔࣅඇαʔϏεΫϥε • RailsͷϨʔϧʹ͍ͬͯͳ͍෦ • Կͷͳ͍Α͏ʹݟ͑Δ • ͕ɺෳਓͰ։ൃΛଓ͚ͯΔͱ……
SomeForm : Before class SomeForm < FormBase validate :something :
: def initialize(params) : : end end
SomeForm : After class SomeForm < FormBase validate :something :
: attr_reader :presenter def initialize(params, presenter) : @presenter = presenter : end def validate presenter.some_methods super end end
Presenter : Before class SomePresenter < PresenterBase attr_reader :form delegate
:save, to: :form def initialize(some_model) @form = SomeForm.new(some_model.attributes, self) end : : end
Presenter : After class SomePresenter < PresenterBase attr_reader :form def
initialize(some_model) @form = SomeForm.new(some_model.attributes, self) end def save : @form.save : end : : end
͕ᐆດͳΫϥεΛऔΓೖΕͯ͠· ͏ • ݁߹্͕Γଓ͚ɺΠϯελϯεͷ૬ޓࢀর ͕ൃੜ • Ͳ͜ʹॻ͚Α͍ͷ͔Θ͔Βͳ͍͠ɺͲ͜ ʹॻ͍ͯΑ͍ؾ͕ͯ͘͠Δ • ৮Γͨ͘ͳ͍͠ɺ৮ΔͱόάΔ
ͷͰɺ࠷খͷ มߋͰٻΊΒΕ͍ͯΔཁ݅Λຬͨ͢Α͏ʹͳΔ • ׂΕ૭ཧ
͕ᐆດͳΫϥεΛऔΓೖΕͯ͠· ͏ • ͜͏͍͏ͱ͜ΖʹݶͬͯɺϏδωεతʹίΞཁ ૉͩͬͨΓ͢Δ • ฐࣾͰ͍͏ͱϞσϧΛϑϩϯτ͔Β࡞͢Δ෦ ʹଘࡏ͍ͯͨ͠ • ͢ͷʹ͘Β͍͔͔Γ·ͨ͠
• ͠ɺ௧Έ͋ͬͨ
ͱ͍͑ • ίʔυϨϏϡʔͯ͠Δ͠ɺCIճ͍ͬͯΔ • ͦΕͰͳ͓ෛ࠴ͱݺΕΔͷ͕ੜ·Ε Δͷͳ͔ͥ
ٕज़తෛ࠴͕ੜ·ΕΔཧ༝ • ҰݸਓʹىҼ • ࣌ؒෆ • ٕज़ྗෆ • ৸ෆ •
͕ɺݱ࣮ʹνʔϜ։ൃͰ͕ࣗΒͳ͍͏ͪ ʹίʔυ͕มߋ͞Ε͍ͯΔͱ͍͏͜ͱΑ͋͘ Δ
ࣄۀతʹՁ͕͋Δͱ͜Ζʹ ෛ࠴ཷ·Γ͍͢ • ࣄۀతʹՁ͕͋Δ • → ଟ͘ػೳཁ͕݅ೖΔ • → ଟ͘ͷϝϯόʔ͕मਖ਼͢ΔՄೳੑ͕͋Δ
• → ͔ͭɺଟ͘ํస͢ΔՄೳੑ͕͋Δ • ෳਓͰಉ͡ՕॴΛසൟʹ৮ΔͷͰɺٕज़తෛ ࠴͕ੜ·Ε͍͢
͖͞΄ͲͷΞϯνύλʔϯ • ࠷ॳͷίʔυ͕ॻ͔Εͨஈ֊ɿ ͻͲ͘ͳ͍ • αʔϏεΛਐΊΔ͋ΔλΠϛϯάͰੜ·Ε ͯ͠·ͬͨͷ • ٕज़తෛ࠴ͷΞϯνύλʔϯ =>
ٕज़తෛ࠴ ΛੜΈग़ͯ͘͢͠͠͠·͏Ξϯνύλʔϯ • ٕज़తෛ࠴ΛੜΈग़͞ͳ͍ίʔυͳ͍ • αʔϏεΛΒͤଓ͚ΔݶΓɺίʔυͷมߋ ආ͚ΒΕͳ͍
େࣄͳ͜ͱ • ։ൃΛग़͠ͳ͕ΒɺػೳՃΛ͠ͳ͕Βί ʔυͷ݈߁ੑΛอͭ͜ͱ • ։ൃ(αʔϏε)͕ਐΉաఔͰίʔυશମΛ၆ ᛌ͢ΔػձΛઃ͚Δ͜ͱ • ͦΕͧΕҧ͏։ൃऀ͕ಉ͡ઢͰίʔυશ ମΛΈଓ͚Δ͜ͱ
ٕज़తෛ࠴ : νʔϜ։ൃ
ٕज़తෛ࠴Λ࡞Βͳ͍
ٕज़తෛ࠴Λ࡞Βͳ͍
ٕज़తෛ࠴ͱ͖߹͏
ٕज़తෛ࠴ͳͥੜ·ΕΔͷ͔ • ෆ࣮֬ੑͷରॲͷࣦഊ • ࣗʹͱͬͯΘ͔Βͳ͍(ෆ࣮֬ͳ)ͷɿ ະདྷͱଞਓ • ͜ΕΒෆ࣮֬ͳͷʹରॲ͖͠Εͳ͔ͬͨ • νʔϜͱͯ͠ɺෆ࣮֬ੑʹͲ͏͖߹͍ͬͯ͘
͔
ٕज़తෛ࠴ͷਖ਼ମ
લʹਐΜͰ͍Δ͔Βͦ͜ͷٕज़తෛ࠴
͜Θ͘ͳ͍ٕज़తෛ࠴ • ͲΜͳʹࠅ͍ίʔυͰɺ͜ͷઌ͍͡Δ͜ͱ͕ ઈରʹͳ͍ͷͰ͋Εෛ࠴Ͱͳ͍ • ٕज़తෛ࠴ʹΑΔਏ͞ͷࠜݯ • ࠓͦͷ࣌ɺػೳΛՃ͠Α͏ͱͯ͠Ͱ͖ ͳ͍ʗͮ͠Β͍ͨΊ •
ࠓͷ͜ͱ͕ࠓΑΓෆ࣮֬ͩͬͨաڈʹɺ͔͠ ͨ͠ΒࣗͰͳ͍ଞਓ͕ॻ͍ͨίʔυΛࠓ͍͡ Δͷ͕ਏ͍
ະདྷ ͷෆ࣮֬ੑ୭ʹରॲ Ͱ͖ͳ͍
ଞਓ ͷෆ࣮֬ੑϝιουͰ ղফͰ͖Δ͔͠Εͳ͍
ଞਓͱͷؒͷෆ࣮֬ੑʹରॲ͢Δϝι ου • ରɾϏδωεαΠυ(ඇΤϯδχΞ) • ϢϏΩλεݴޠ • ରɾΤϯδχΞ • ઃܭ(ਤͷڞ༗)
ଞਓͱͷؒͷෆ࣮֬ੑʹରॲ͢Δϝι ου • ରɾϏδωεαΠυ(ඇΤϯδχΞ) • ϢϏΩλεݴޠ • ରɾΤϯδχΞ • ઃܭ(ਤͷڞ༗)
• ଞͷ෦ʹ͍ͭͯલग़ͷຊ͕ৄ͍͠
ਤΛڞ༗͢Δ https://speakerdeck.com/joker1007/realworld- domain-model-on-rails
ਤΛڞ༗͢Δ https://speakerdeck.com/joker1007/realworld- domain-model-on-rails
νʔϜͰਤΛڞ༗͢ΔͨΊʹ৺͕͚ ͍ͯΔ͜ͱ • ਤ͕͢Ͱʹ͋Ε • ڊਓͷݞͷ্ʹཱͭɿϨʔϧʹΓଓ͚Δ • ਤ͕ͳ͍ͷͰ͋Ε • ਤΛ࡞ͬͯ
ڭ͢Δ
ϨʔϧʹΓଓ͚Δͱ͍͏બ • Railsͷ͍͢͝ͱ͜Ζ • Ϩʔϧͱ͍͏໊ͷਤ͕͍ൣғͰڞ༗͞ Ε͍ͯΔ͜ͱ • CoC (Convention over
Configuration) • RailsΤϯδχΞRailsϓϩδΣΫτͰ͋Εଈ ઓྗΛظͰ͖Δ(ࣄ͕ଟ͍) • Ϩʔϧ͔Β֎Ε·ͬͯͨ͘߹ผ͕ͩ
ਤ͕ͳ͍෦ʹ໘ͨ͠Β • ͱ͍͑ɺਤͷͳ͍Ҭଟ͍ • ͦͷձࣾಛ༗ͷΧϧνϟʔ • ฐࣾͩͬͨΒσʔλετΞܥͷ֓೦͕ଟ͘ ଘࡏ͢Δ • ਤΛ࣋ͨͳ͍ਓ:
ͲΜͳਤ͕͍Δͷ͔ͷΤ εΧϨ • ਤΛ࣋ͭਓ: ਤΛ͘Β͠ΊΔྗ
·ͣॻ͍ͯΈΔ
ϨϏϡʔΛґཔ
ͨΓલͩ͠ຯ͚ͩͲɺ͢ ͘͝େࣄ !
ࣼʹߏ͍͑ͯͯ͝ΊΜͳ͍͞ !
·ͱΊ • ٕज़తෛ࠴ɿωΨςΟϒͳΠϝʔδ • ͍ΘΏΔٕज़తෛ࠴ʹΑΔѱӨڹ • ࠓͦͷ࣌ɺखΛՃ͑Α͏ͱ͢Δׂ͕ࣗ৯ ͍ͬͯΔͨΊ • ࣗࣗίϯτϩʔϧՄೳ(Ͱ͢ΑͶʁ)
• ίϯτϩʔϧෆೳͳͷ ະདྷͱଞਓ
·ͱΊ • ະདྷͷෆ࣮֬ੑͷରॲఘΊͨʹͯ͠ɺଞ ਓͱͷෆ࣮֬ੑͳΒݮΒͤΔ͔ • νʔϜͰਤΛڞ༗͠Α͏ • ྑ͖νʔϜ։ൃΛʂ • ະདྷ͕ݟ͑ͳ͍ʁͦΕͳΒ……
We are hiring!! • ΞϐʔϧϙΠϯτ • େنσʔλ / B to
B ͳΒͰͷݻ͞ • َͷΑ͏ʹίʔυ͕ॻ͚Δ • ఆ࣌ͷ֓೦͕ͳ͍ • ࣗ༝ʗϦϞʔτϫʔΫࣗ༝ • Conferenceνέοτ͕ग़Δ
એɿRepro Tech Meetup https://repro-tech.connpass.com/event/94282/
Happy Hacking!!
ࢀߟ: શମΞʔΩςΫνϟڞ༗