Manual vs Framework DI

Manual Injection Versus a Framework

You don't need a library to inject dependencies. Manual injection puts every construction decision in one hand-written container, created once by the Application and read by every factory:

Manual injection: a hand-written container behind the factory of Section 5.23.2JavaScript
class AppContainer(app: Application) {
  val bookRepository: BookRepository by lazy { AssetBookRepository(app.assets) }  // one
}
class BookNestApp : Application() { val container by lazy { AppContainer(this) } }
// every factory: initializer { CatalogViewModel(app.container.bookRepository) }

This is fast and easy to debug, and Google's guide starts here before naming Hilt "Jetpack 234 's recommended library for dependency injection". It scales badly: every ViewModel needs a factory, a lifetime between "the app" and "one screen" (a checkout flow) needs a second container you manage yourself, and a forgotten lazy quietly creates a second database. A framework reads the constructors instead, ties lifetimes to Android's own, and lets a test replace one module.