Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Do Dependency Injection Frameworks like ButterKnife and Dagger Make apps slower?

I'm about to start a relatively big project and was wondering

What are the real benefits of using these dependency injection frameworks?

Does DI increase app load times? Or offer any performance value?

Googles documentation goes against using Robojuice because of its RAM usage, is this something common across all DI's?

Interested to hear everybody's opinion.

like image 396
Shifty Avatar asked Jan 24 '15 08:01

Shifty


People also ask

What are the benefits of dagger?

Benefits of using Dagger Dagger frees you from writing tedious and error-prone boilerplate code by: Generating the AppContainer code (application graph) that you manually implemented in the manual DI section. Creating factories for the classes available in the application graph.

What is advantage of dependency injection in Android?

Reduces the boilerplate code. Makes our code reusable and clean. Makes it easy to replace our dependencies with fake implementations which make testing easier. Helps us enable loose coupling.

What is dependency injection dagger?

The term dependency injection context is typically used to describe the set of objects which can be injected. In Dagger 2, classes annotated with @Module are responsible for providing objects which can be injected. Such classes can define methods annotated with @Provides .

What is dagger dependency injection Android?

Dagger 2 is a compile-time android dependency injection framework that uses Java Specification Request 330 and Annotations. Some of the basic annotations that are used in dagger 2 are: @Module This annotation is used over the class which is used to construct objects and provide the dependencies.


1 Answers

I work for NYTimes and it takes less than 100ms to instantiate hundreds of managed objects across 2 scopes using Dagger 2. Dagger helps us organize objects and remove a lot of boilerplate from activities or business objects. I would recommend it for any size app.

like image 127
FriendlyMikhail Avatar answered Oct 03 '22 00:10

FriendlyMikhail