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
850
QucikSettingsTileAPI
funnelbit
0
390
Mobile Vision
funnelbit
0
490
AwarenessAPI
funnelbit
0
170
Other Decks in Technology
See All in Technology
Cursor Meetup Sapporo - Cursor物語 続編
cocacola917
0
140
名刺メーカーDevグループ 紹介資料
sansan33
PRO
0
1.2k
関東Kaggler会発表資料
takoi
1
200
20260608_Codexの可能性_ノンプログラマー向け_大城追記
doradora09
PRO
0
780
サイバー捜査員研修(後半)
nomizone
1
810
Webアクセシビリティ入門 2026
recruitengineers
PRO
3
460
Digitization部 紹介資料
sansan33
PRO
2
7.7k
制約理論(ToC)入門 2026版
recruitengineers
PRO
7
2.1k
クラウドセキュリティ入門 ~安全なクラウド利用のための基礎知識~
lhazy
12
8.4k
第3回しろおびセキュリティスポンサーセッション
log0417
0
160
つくって納得、つかって実感! 大規模言語モデルことはじめ ver2.0
recruitengineers
PRO
4
1.2k
【CEDEC2026】専門性の高いデフォルメチームが挑んだ人材育成戦略 〜Cygames Academiaの企画から実施まで〜
cygames
PRO
0
530
Featured
See All Featured
職位にかかわらず全員がリーダーシップを発揮するチーム作り / Building a team where everyone can demonstrate leadership regardless of position
madoxten
64
56k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
32
3k
The browser strikes back
jonoalderson
0
1.5k
Digital Ethics as a Driver of Design Innovation
axbom
PRO
1
360
Writing Fast Ruby
sferik
630
63k
Become a Pro
speakerdeck
PRO
31
6.2k
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.8k
Sam Torres - BigQuery for SEOs
techseoconnect
PRO
0
460
Making Projects Easy
brettharned
120
6.7k
The Anti-SEO Checklist Checklist. Pubcon Cyber Week
ryanjones
0
200
Mozcon NYC 2025: Stop Losing SEO Traffic
samtorres
1
480
Build The Right Thing And Hit Your Dates
maggiecrowley
39
3.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
͋Γ͕ͱ͏͍͟͝·ͨ͠