Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
DI整備でneedleを使った話
Search
kamui_project
October 31, 2022
Technology
340
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
DI整備でneedleを使った話
kamui_project
October 31, 2022
More Decks by kamui_project
See All by kamui_project
String Catalog
tony1224
1
2.5k
meetup_201910.pdf
tony1224
0
180
potatotips_201906.pdf
tony1224
0
97
potatotips_201905.pdf
tony1224
1
500
andfactory_201903.pdf
tony1224
0
1.3k
Dividing Model into layers and implementing Unit Test
tony1224
1
1.3k
WWDC18 cherry-pick Xcode 10 beta
tony1224
0
350
Other Decks in Technology
See All in Technology
「とりあえず動く」の先へ。 AI時代のチーム開発と内部設計/2026-slsdays
slsops
0
100
20260929_AmazonGuardDutyの検出通知メールにAWS DevOpsAgentの調査結果を追加する
yhana
1
410
プラットフォームを「作る」、 チームに「入り込む」
sansantech
PRO
0
440
[2026-09-30]ロックンロールは鳴り止まないっ - 信頼性かまってちゃん - 「データ駆動を投げ捨ててまで。」追いかける信頼性改善に向けた取り組みの話
tosite
0
180
CI/CDではもう遅い - 人とAIが迂回しないDevSecOps Verify基盤の再設計 -
kintotechdev
1
630
Meet AgentCore Identity Consent Portal
hironobuiga
3
150
AI駆動開発で仕様はどこまで書くべきか? ― 人とAIの責務境界から考える開発プロセスの実践
takahiromatsui
1
290
猫でもわかるKiro Web
kentapapa
1
160
Execution in the Kingdom of Agents: Reflections on Abstraction and Complexity
bcantrill
0
670
雪かき部 #7 もう怖くない!SELECT文!
foursue
0
270
いちAWSエンジニアのAI活用を振り返る #devio2026 / devio osaka 2026 kawahara
masahirokawahara
2
310
Databricksメトリクスビューはじめてのもくもく会
taka_aki
0
150
Featured
See All Featured
BBQ
matthewcrist
89
10k
Heart Work Chapter 1 - Part 1
lfama
PRO
10
36k
Accessibility Awareness
sabderemane
1
230
Google's AI Overviews - The New Search
badams
0
1.6k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
35
2.9k
JAMstack: Web Apps at Ludicrous Speed - All Things Open 2022
reverentgeek
1
620
Hiding What from Whom? A Critical Review of the History of Programming languages for Music
tomoyanonymous
3
1.3k
Ethics towards AI in product and experience design
skipperchong
2
410
Breaking role norms: Why Content Design is so much more than writing copy - Taylor Woolridge
uxyall
1
430
Art, The Web, and Tiny UX
lynnandtonic
304
22k
Building Flexible Design Systems
yeseniaperezcruz
330
41k
AI Search: Where Are We & What Can We Do About It?
aleyda
0
8k
Transcript
DI整備でneedleを使った話 2022/10/31 #79 potatotips
自己紹介 name: かむい @kamui_project company: REALITY Inc. potato tips latest
presentation: #62
弊社のDI整備のお話
note紹介 第1弾: needleでDI改善に取り組み始めた話 第2弾: needleでモジュール間の画面遷移を実 現した話 第3弾: ↑をSwiftUIで実現した話 「REALITY needle」
で検索すると出てきます
プロダクト環境の背景 リリース: 2018/8/4〜現在 主な出来事: 機能拡充, iOS新技術の積極採用, EN積極採用 View作成: UIKit →
SwiftUI / UIKit チーム文化: プレゼンテーションロジックのUnit Testは 積極的に書いている
プロダクト環境の背景 リリース: 2018/8/4〜現在 主な出来事: 機能拡充, iOS新技術の積極採用, EN積極採用 View作成: UIKit →
SwiftUI / UIKit チーム文化: プレゼンテーションロジックのUnit Testは 積極的に書いている → initializerのパラメータにデフォルト引数が 有ったり無かったり → Bastard Injection
Bastard Injection • DIのアンチパタン • デフォルト引数 → Testabilityの観点では問題は無い • DIの動機として他クラスへの依存を減らしたい
◦ 依存対象をI/Fに留めたい ◦ 結合が強くなる 弊社のDI整備 ⇨ Bastard Injectionの解消 + DIルールの整理 • DIルールの整理 ◦ 依存はI/Fに留める, ViewControllerの初期化ルール 等 ▪ 依存解決のためのコードを書く手間🤔 ▪ コンパイラセーフ🤔 DIの課題と整備
None
• オブジェクト間の依存解決コードをコンパイル時に自動 生成してくれるツール ◦ AndroidのDaggerと似ている ◦ コンパイル時にDI注入の安全性を確保 ▪ 自信を持ってコード変更ができる •
DI構造が階層的且つ実装上の登場人物が少なくシンプル • 誤ったDI注入があった際には問題箇所の変数名・型・階 層をエラー文で教えてくれる とは
とは https://github.com/uber/needle/blob/master/README.md
とは https://note.com/reality_eng/n/n124fd7da93c3
とは https://note.com/reality_eng/n/n124fd7da93c3
現在の状況と今後の展望 https://note.com/reality_eng/n/n124fd7da93c3
現在の状況と今後の展望 https://note.com/reality_eng/n/nbe40c0e17690
現在の状況と今後の展望
• 課題: Bastard InjectionなDIをしていた箇所が多く存在 • アクション: DIの整備を進めていく中で、依存問題解決のコー ド生成をneedleを使い自動化 • 現状:
起動画面ほか複数の画面で導入・拡充を進める • 今後の展望: モジュール間の画面遷移もneedleの仕組みを介す 形で実現していきたい まとめ
最後に
最後に