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
Asynchronous Injection
Search
funnelbit
June 22, 2016
Technology
290
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Asynchronous Injection
funnelbit
June 22, 2016
More Decks by funnelbit
See All by funnelbit
Hatena Engineer Seminar #9
funnelbit
5
7.5k
droidkaigi-2017-renovation
funnelbit
10
11k
Dart
funnelbit
0
300
BottomBarAndSnackBar
funnelbit
0
550
Dagger2 Optional bindings
funnelbit
0
620
WearableRecyclerView
funnelbit
1
840
QucikSettingsTileAPI
funnelbit
0
380
Mobile Vision
funnelbit
0
490
AwarenessAPI
funnelbit
0
170
Other Decks in Technology
See All in Technology
kaonavi Tech Night#1
kaonavi
0
120
複数プロダクトで進めるAI機能実装 ── 実践から得たリアルな学びとロードマップ実現への挑戦 / AICon2026_yanari
rakus_dev
0
140
Genie Ontologyは銀の弾丸かを考える / Is Genie Ontology a Silver Bullet?
nttcom
0
420
実践!既存 Project への AI-Driven Development 適用〜 一ヶ月で Project 唯一のフロントエンドエンジニアを作り出せ〜
lycorptech_jp
PRO
0
250
個人開発で育てる「大規模設計の苗床」 - AI時代の1人開発から始める業務への知識接続 / The Seedbed for Large-Scale Design - From AI-Era Solo Projects to Professional Knowledge
bitkey
PRO
1
280
関数型の考えを TypeScript に持ち込んで、テストしやすい純粋関数を増やす / Pure at the Core, Effects at the Edge: Bringing Functional Thinking into TypeScript
kaminashi
2
130
「守りたい体験」を渡すだけで E2E を生成させられるようになった話
hinac0
1
760
凡エンジニアがこの先生きのこるためには。〜TypeScript完全に理解したい〜
alchemy1115
2
310
そのドキュメント、自動化しませんか?
yuksew
1
320
ヘルスケア領域における AI 活用と その安全性担保のための取り組み (Leveraging AI in Healthcare and Our Efforts to Ensure Its Safety) - Google I/O Extended Tokyo 2026, July 11, 2026
zettaittenani
0
430
脱金融のフューチャー・デザイン / Future Design Beyond Finance
ks91
PRO
0
160
Playwright × AI Agent でE2Eテストはどう変わるか AI駆動テストの可能性と実用検証の結果
taiga7543
1
550
Featured
See All Featured
世界の人気アプリ100個を分析して見えたペイウォール設計の心得
akihiro_kokubo
PRO
72
40k
Darren the Foodie - Storyboard
khoart
PRO
3
3.4k
It's Worth the Effort
3n
188
29k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
21
1.5k
AI Search: Implications for SEO and How to Move Forward - #ShenzhenSEOConference
aleyda
1
1.3k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
10
1.3k
Leo the Paperboy
mayatellez
8
1.9k
Crafting Experiences
bethany
1
220
Effective software design: The role of men in debugging patriarchy in IT @ Voxxed Days AMS
baasie
0
450
A designer walks into a library…
pauljervisheath
211
24k
How to Grow Your eCommerce with AI & Automation
katarinadahlin
PRO
1
230
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
9
1.4k
Transcript
"TZODISPOPVT*OKFDUJPO JEGVOOFMCJU
ࣗݾհ ଜྋ )BUFOBGVOOFMCJU 5XJUUFS!FYQFSPQFSP
None
"OESPJE Ͱ ඇಉظ ʹ ґଘղܾ͢Δ
%BHHFS 1SPEVDFST w ඇಉظͰґଘղܾ͢ΔΈΛఏڙ
؆୯ͳྫ w .PEVMFº w $PNQPOFOU w "DUJWJUZ
.PEVMF @ProducerModule final class AppProducerModule { @Produces ListenableFuture<UserData> getUserData() {
// ~ ͳΜ͔ΊͬͪΌ͕͔͔࣌ؒΔॲཧ ~ return Futures.immediateFuture(new UserData("userName")); } @Produces String userName(UserData userData) { return userData.name; // Activity ͜Ε͕΄͍͠ }
.PEVMF @ProducerModule final class AppProducerModule { @Produces ListenableFuture<UserData> getUserData() {
// 1 // ~ ͳΜ͔ΊͬͪΌ͕͔͔࣌ؒΔॲཧ ~ return Futures.immediateFuture(new UserData("userName")); } @Produces String userName(UserData userData) { // 2 return userData.name; // Activity ͜Ε͕΄͍͠ }
.PEVMF @Module public class ExecutorModule { @Provides @Production static Executor
executor() { return Executors.newCachedThreadPool(); } }
$PNQPOFOU @ProductionComponent(modules = { ExecutorModule.class, AppProducerModule.class}) public interface AppProducerComponent {
ListenableFuture<String> userName(); }
"DUJWJUZ … ListenableFuture<String> userDataListenableFuture = DaggerAppProducerComponent.create().userName(); Futures.addCallback( userDataListenableFuture, new FutureCallback<String>()
{ @Override public void onSuccess(String result) { Log.e("name", result); } @Override public void onFailure(Throwable t) { Log.e("failure", t.toString()); } }); …
1SPEVDFS5
.PEVMF @ProducerModule public class AppProducerLazyModule { @Produces @Normal ListenableFuture<UserData> provideNUserData()
{ return Futures.immediateFuture(new UserData("normal")); } @Produces @Special ListenableFuture<UserData> provideSUserData() { return Futures.immediateFuture(new UserData("special")); } @Produces ListenableFuture<UserData> provideUserData( @Normal Producer<UserData> nProducer, @Special Producer<UserData> sProducer) { return sProducer.get(); } }
@ProducerModule public class MyModule { @Produces ListenableFuture<A> a() { …
} @Produces ListenableFuture<B> b(A a) { … } @Produces ListenableFuture<C> c(B b) { … } @Produces @Delayed ListenableFuture<C> delayedC(A a, Producer<C> c) { … return c.get(); } }
@ProducerModule public class MyModule { @Produces ListenableFuture<A> a() { …
} // 1 @Produces ListenableFuture<B> b(A a) { … } // 3 @Produces ListenableFuture<C> c(B b) { … } // 4 @Produces @Delayed ListenableFuture<C> delayedC(A a, Producer<C> c) { … return c.get(); } // 2 }
1SPEVDFE5
.PEVMF @ProducerModule final class AppProducerModule { @Produces ListenableFuture<UserData> getUserData() {
// ~ ͳΜ͔ΊͬͪΌ͕͔͔࣌ؒΔॲཧ ~ throw new IllegalStateException(); // Θ͟ͱམͱ͢ } @Produces String userName(Produced<UserData> userData) { try { return userData.get().name; } catch (ExecutionException e) { e.printStackTrace(); return "Կ͔͕ى͖ͨ"; } } }
ৄࡉ w IUUQHPPHMFHJUIVCJPEBHHFSQSPEVDFST
͋Γ͕ͱ͏͍͟͝·ͨ͠