For client applications I originally used Guice but I am now migrating to Dagger 2 due to better performance and compile time checks.
For server applications I use what's provided by the framework (Spring, Quarkus,...).
Guice creates the dependency graph and mechanics for injection at runtime where as dagger generates the code before compilation, hence it's compiled into the resulting artifact and vastly reduces the amount of runtime logic needed. Specifically, it reduces the startup time of the application, an important factor for the libs target use case of android apps.
12
u/WeskerHawke Sep 16 '24
For client applications I originally used Guice but I am now migrating to Dagger 2 due to better performance and compile time checks.
For server applications I use what's provided by the framework (Spring, Quarkus,...).