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
Dependency Injection by Aadithya at SwiftDelhi
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Swift India
July 16, 2017
Programming
91
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Dependency Injection by Aadithya at SwiftDelhi
Dependency Injection by Aadithya at SwiftDelhi
Swift India
July 16, 2017
More Decks by Swift India
See All by Swift India
Network Layer Abstraction
swiftindia
0
190
Efficient JSON to Object Parsing
swiftindia
0
180
Sign In with Apple
swiftindia
0
180
Furlenco's AR Journey
swiftindia
0
160
Image processing using Core Image and Metal
swiftindia
0
260
Combine - Diving into Apple’s Reactive Programming
swiftindia
1
300
Social in Hotstar
swiftindia
0
270
Improving App Launch Time
swiftindia
1
150
Backend Driven UIs
swiftindia
0
160
Other Decks in Programming
See All in Programming
Laravel Boostに学ぶ、AIにPHPを書かせる技術 〜OSSの実装から蒸留するエージェント制御の王道〜
kentaroutakeda
3
470
任せる範囲はこう広がった / How the Scope of AI Delegation Has Expanded
nrslib
1
260
ローカルLLMでどこまでコードが書けるか -拡張版 / How much code can be written on a local LLM Extended
kishida
12
4.8k
言語を使う側から、作る側へ。 自作 Lisp で得た新たな気づき。
andpad
0
130
えっ!!コードを読まずに開発を!?
hananouchi
0
220
【SRE NEXT 2026 Lunch Session】一人目専任SREの立ち上げを加速する ― AIと進めたオンボーディングで2分を0.04秒にした話
pkshadeck
PRO
0
2.8k
Generative UI & AI-Assistants for Your Angular Solutions
manfredsteyer
PRO
1
190
AIを活用したE2Eテスト実装効率化のあゆみ / ebisu-mobile-14-kotetu
kotetuco
0
170
地域 SRE コミュニティ最前線 - ホンマでっかSRE勉強会
tk3fftk
0
250
AI時代、エンジニアはどう育つのか -未経験エンジニアの成長を間近で見て考えたこと-
thasu0123
0
130
1年で人数1.5倍、PR数5.5倍増。 品質とアウトカムはどうなったか、 何が効いたか
ike002jp
0
140
共通化で考えるべきは、実装より公開する型だった
codeegg
0
250
Featured
See All Featured
Rebuilding a faster, lazier Slack
samanthasiow
85
9.6k
Jamie Indigo - Trashchat’s Guide to Black Boxes: Technical SEO Tactics for LLMs
techseoconnect
PRO
0
380
Designing for Performance
lara
611
70k
The browser strikes back
jonoalderson
0
1.4k
A brief & incomplete history of UX Design for the World Wide Web: 1989–2019
jct
2
420
The agentic SEO stack - context over prompts
schlessera
0
850
How Fast Is Fast Enough? [PerfNow 2025]
tammyeverts
3
660
SEO Brein meetup: CTRL+C is not how to scale international SEO
lindahogenes
1
2.8k
エンジニアに許された特別な時間の終わり
watany
108
250k
[RailsConf 2023] Rails as a piece of cake
palkan
59
6.8k
The Art of Programming - Codeland 2020
erikaheidi
57
14k
State of Search Keynote: SEO is Dead Long Live SEO
ryanjones
0
220
Transcript
Dependency Injection Adithya Reddy iOS engineer at UrbanClap
What. Why. How.
What is dependency Injection? It’s a fancy name for a
fairly simple concept.
Is DI used in this code snippet below? NO
What about this? YES
And this? NO
Traditional way: Race car Engine Transmission Piston Shaft Clutch Flywheel
Dependency injection way: Race car Engine Transmission Piston Shaft Clutch
Flywheel
Why use dependency Injection? 3 C’s Clarity Customizability Concerns
Clarity Callers need to know only about one thing, i.e.
initializer init() is clean and not dumped with constructors No unexpected behavior Example: if a new person joins the team, he need not go throught the viewcontroller to find the dependent objects in it. He just needs to look at init and inject.
Customizability Have control over which implementation to use. For example:
I can plug in Engine with FastEngine without worrying much Also, highly useful in testing. X1 in debug mode and X2 in release mode.
Concerns Race car is just a race car. Need not
worry about the configuration of other parts. Specific purposes lying in each component Allows composing instead of subclassing
Constructor injection vs Setter injection Constructor injection : use when
values dont change Setter injection : use when required. When you want to set the dependencies via properties
How to setup and use dependency injection? Now, I will
demonstrate how to integrate the Typhoon framework to achieve DI. Concept of Assemblies
Coming back… Now… you must be able to answer why
the code snippet below doesnt confirm to DI...
Why does this confirm to DI?
And finally, why doesnt this confirm to DI?