- Видео 1
- Просмотров 2 840
Maxim Pestryakov
Добавлен 27 июл 2013
droidcon London 2018 - Helping Dagger Help You
As applications grow in size, Dagger can help mitigate the pain of dependency management and eliminate the boilerplate of manual dependency injection. Despite this, there are still pain points such as slower compilation times and how to inject objects like activities and views. This talk will cover functionality provided by libraries which build on top of Dagger to reduce these pain points. Jake will start with the built-in 'dagger-android' library to see how it works and the most efficient ways it can be used. You'll learn what assisted injection is, why you might use it, and look at a library which simplifies the pattern. And finally together with Jake you'll attempt to solve the build ...
Просмотров: 2 840
Dagger needs too many modules and code blocks inside them.
Dagger is garbage, say, I have a hundred activities all using shared preferences. I have to declare a 100 activities to inject them for shared preferences. You'd think, Dagger could handle a silly simpleton scenario such as this, but, hey, its Dagger. Anything to declare Jake?
Why do you even have 100 Activities and why are you not using 1 global Dagger instance that exposes SharedPreferences as a provision method? Boom you no longer need 100 inject method calls, GG your turn
how we write this statement in java lateinit va userId : String
this is a lazy initialization, you could search for it
`String userId;` you're welcome.