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
「最後に責任を取るのはチーム」— 人間のPRレビューを最小化してアップデートしたメンタルモデル
jnishime_dresscode
0
920
AI時代のPlaywright活用(システムテストを自動化する ー 実行エンジンにPla ywrightを選んだ理由)
ynisqa1988
1
360
“それは自分の仕事じゃない"を越えて行け
yuukiyo
1
480
変更し続けられるシステムをどう保つか — AI時代のSSoTという設計原則
kawauso
0
130
AIが実装を自走する時代の認知負債との戦い
lycorptech_jp
PRO
1
310
OpenTelemetryにおけるGoのゼロコード・コンパイル時計装について #fukuokago
quiver
0
110
「AIに依存している」と 「AIを使いこなしている」の違い
k8yasuma
0
120
Oracle Base Database Service 技術詳細
oracle4engineer
PRO
15
110k
10年目を迎えた「ABEMA」がどのように AI 活用を推進して、AI 駆動開発にシフトしているのか / How ABEMA, entering its 10th year, is promoting the use of AI and shifting toward AI-driven development
miyukki
0
280
AI Driven AI Governance
pict3
0
490
「守りたい体験」を渡すだけで E2E を生成させられるようになった話
hinac0
1
420
凡エンジニアがこの先生きのこるためには。〜TypeScript完全に理解したい〜
alchemy1115
2
310
Featured
See All Featured
Color Theory Basics | Prateek | Gurzu
gurzu
0
390
What does AI have to do with Human Rights?
axbom
PRO
1
2.2k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
12
1.2k
Facilitating Awesome Meetings
lara
57
7k
SEO for Brand Visibility & Recognition
aleyda
0
4.6k
What’s in a name? Adding method to the madness
productmarketing
PRO
24
4.1k
The Organizational Zoo: Understanding Human Behavior Agility Through Metaphoric Constructive Conversations (based on the works of Arthur Shelley, Ph.D)
kimpetersen
PRO
0
390
HU Berlin: Industrial-Strength Natural Language Processing with spaCy and Prodigy
inesmontani
PRO
0
530
Efficient Content Optimization with Google Search Console & Apps Script
katarinadahlin
PRO
1
730
Digital Ethics as a Driver of Design Innovation
axbom
PRO
1
340
Tell your own story through comics
letsgokoyo
1
1k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
49
3.5k
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
͋Γ͕ͱ͏͍͟͝·ͨ͠