Java • Based on annotation processing, not reflection, to aim high performance Dagger is a fully static, compile-time dependency injection framework for both Java and Android. It is an adaptation of an earlier version created by Square and now maintained by Google. from official document
of architecture ◦ Focus only on business logic ◦ Better for Unit Test and Refactoring ◦ Reconfigurable without recompile • Disadvantages ◦ Make code difficult to trace or read ◦ More complexity on initializing architecture ◦ Need to be apply design principle
creation of object. (Which object is injected into?) • Rule is defined by @Component, @Module • Mark something that need to be injected with annotation • Call inject() function
to DI Principle • Dagger doesn’t convert code to DI pattern from plain code • Dagger just help to make code, already applied DI pattern, concise • If you wanna dagger’s advantages, change your code to DI pattern.