Difference between roboGuice and butter knife dependency injection

970 Views Asked by At

I have heard there two major dependency injection libraries used in android one is roboguice and the other one is ButterKnife the main difference between them is roboguice is run time and buttter knife is compile time,so i am confused which has better performance on application wheather its run time or compile,if any idea throws your thoughts here.

3

There are 3 best solutions below

2
On BEST ANSWER

Butter Knife will always be faster because it's based on code generation rather than reflection.

However, you can't call what it does dependency injection. It's just view lookup. It could potentially be called view binding as well. The fact that it refers to itself as "view injection" (note the quotes) is a tongue-in-cheek joke.

0
On

Butterknife does not seem to me a dependency injection library. Rather than I can call it a view library which makes binding easier, reduces findViewById(...) statements. There is an article comparing these two libraries http://java.dzone.com/articles/dependency-injection-roboguice

0
On

I've been using Roboguice for 3 months and I think it's a really close approximation of what Spring framework does (using injection). Roboguice is really powerful and lets you inject views, Interfaces and classes (even with the app/activity context if you need it).

Even, If you are worried about Roboguice performance, they've launched Roboblender which helps to improve significantly Roboguice performance.

You may find Roboguice documentation in the following Github link