What
is Dependency Injection?
It's a design pattern in Android that allows
writing codes for low coupling and also makes it possible to change them any
time.
Benefits:
- Promotes loose coupling between classes and subsystems
- Easy to use and modify the components
- Testing the functionalities is easy too
Libraries
available in Android:
- ButterKnife
- Roboguice
- Android Annotations
- Dagger 2
Dependency
Injection with ButterKnife :
ButterKnife helps to represent the views from an
activity or fragment and also helps in handling various events like onClick(),
onLongClick() etc. through annotations.

No comments:
Post a Comment