What are the main advantages of DI?
Why is tightly coupled code bad?
What is an example of tightly coupled code?
An example of tightly coupled code is when an instance of a class is instantiated WITHIN another class rather than being dependency injected via the constructor.
What are the two main ways of doing manual dependency injection?
2. Field injection (setter methods)
What are the issues with manual dependency injection?
What are the two categories of libraries that automate the process of creating & providing dependencies?
What is dagger?
A dependency injection library for Kotlin/Java/Android that creates and manages the graph of dependencies for you. Provides static, compile-time dependencies that are better than using the reflection-based solutions.
What is the Service Locator pattern?
The service locator is a class that creates, stores and injects dependencies on demand.
What is the Service Locator like in comparison to Dependency Injection?
What is Hilt?
A Jetpack library for DI in Android. It provides containers for each Android class and manages their lifecycles automatically. It’s built ontop of Dagger to benefit from Daggers epicness.