Posts

Showing posts from June, 2021

DAGGER - Hilt - Dependency Injection

Dependency injection is a design pattern and not a library Is a compile time android dependency injection framework Dependency injection  makes it easy to create loosely coupled components, which means that components consume functionality defined by interfaces without having any knowledge of which implementation classes are being used. Reduces the boilerplate codes Enhances code reusability and decouples dependencies Refactoring becomes easy Testing becomes easy It allows our code to be more loosely coupled because classes do not have hard-coded dependencies Dagger : Is a fully static compile time dependency framework for Java, Kotlin and android  Works at compile time i.e it automatically generates the codes for DI that we need to write manually Benefits : It generates the AppContainer automatically during compile time It creates factory for classes available in the application graph to satisfy dependencies Decides whether to reuse the dependency or create a new instance wit...