Recently researched the dependency injection framework that the Android platform can use. Found that there are now four kinds of commonly used. Dagger, Butter Knife, Roboguice, Android Annotations. After a series of comparisons, finally our choice
Narrowed down to the 2 frames of dagger, Butter knife. In fact, domestic and foreign use of more than should be dagger. But I think it is still a little complicated, and then look at Jakewharton blog, he also mentioned Dagger, I
Excerpt from the answer to the question he answered difference between Dagger and Butterknife Android on StackOverflow. Under the simple translation, some people say that butter knife is simply doing a binding view operation, not
The real inject. Dagger is the real inject. Jakewharton replied below that if you use dagger, you will want to die on the view injection. (Haha, a bit of the opposite meaning.) )。 Butter knife really isn't.
In the strict sense of injection, the reason is called view injection, because some people in the use of Dagger said view injection too troublesome. So there will be the birth of butter knife. Butter knife is so simple and rough, you can
It's okay to call him straight findViewById . (Haha, really a little angry!) )
Well, to here, should understand Butterknife and dagger different, in fact, should say butterknife is a supplement to dagger, butterknife only focuses on the injection of the view. The others use dagger. Me
We are now ready to adopt Butterknife, and later with the use of dagger strategy. Hope to help the two see the hesitation of friends.
Simple comparison of Android Dependency Injection framework Butterknife and Dagger