Dagger2

A fast dependency injector for Android and Java. (by google)

Dagger2 Alternatives

Similar projects and alternatives to Dagger2

  • GitHub repo koin

    Koin - a pragmatic lightweight dependency injection framework for Kotlin

  • GitHub repo command-line-api

    Command line parsing, invocation, and rendering of terminal output.

  • GitHub repo Slide

    Slide is an open sourced, ad free Reddit browser for Android

  • GitHub repo PeopleInSpace

    Minimal Kotlin Multiplatform project with SwiftUI, Jetpack Compose, Compose for Desktop, Compose for Web and Kotlin/JS + React clients along with Ktor backend.

  • GitHub repo AssistedInject

    Constructor-inject views during XML layout inflation [Moved to: https://github.com/cashapp/InflationInject]

  • GitHub repo Vigilante

    🛡️ Android security (camera/microphone dots indicators) app using Hilt, Animations, Coroutines, Material, StateFlow, Jetpack (Room, ViewModel, Paging, Security, Biometrics, Start-up) based on MVVM architecture.

  • GitHub repo kompass

    Kotlin Multiplatform Router for Android and iOS

  • GitHub repo DaggerViewModelExperiment

    [DEPRECATED, EXPERIMENT] This is a PoC example for app->activity->fragment subscoping with Subcomponents + ViewModel by SavedStateHandle (using AutoFactory). You shouldn't use this setup, because it breaks scoping. Refer to https://github.com/Zhuinden/jetpack-navigation-ftue-sample for a proper setup.

NOTE: The number of mentions on this list indicates mentions on common posts. Hence, a higher number means a better Dagger2 alternative or higher similarity.

Posts

Posts where Dagger2 has been mentioned. We have used some of these posts to build our list of alternatives and similar projects - the last one was on 2021-06-23.
  • Kotlin 1.5.20 Released
    Note, that this version breaks Hilt code processing. dagger GitHub issue
  • View Model Doesn’t Have To Depend on ViewModel
    Technically, their Jetpack Navigation integration using this somewhat awkwardly named public method does resolve the issue, but then you're forced to use Jetpack Navigation and ViewModelStoreOwner and the rest, because that's the only thing it works with. And AFAIK the SavedStateProvider in SavedStateHandle is private, so you can't even register a custom SavedStateHandle to the SavedStateRegistry yourself - basically, vendor lock-in because the API was not designed to be extensible beyond what Google internals needed.
  • Android Studio Arctic Fox Beta 4
    Workaround in this comment on https://github.com/google/dagger/issues/2634
  • hilt-lifecycle-viewmodel 1.0.0 failing to resolve with gradle
  • Dagger Android 2.28 deprecated
  • Any example of an App written with, and without, Dependency Inversion?
    reddit.com/r/java | 2021-05-09
    DI isn't even that complicated. The Dagger framework is a fantastic compile-time DI framework. It's so simple to use and adds no delay.
  • Hilt is stable! Easier dependency injection on Android
  • Is the era of reflection-heavy C# libraries at an end?
    reddit.com/r/dotnet | 2021-05-03
    When I was working on an Android app, I used Dagger ( https://dagger.dev/ ) which is a dependency injection library that uses source code generation. The benefits were quite considerable! Cyclic dependencies become compilation errors. There is no startup overhead. It only takes a single keyboard shortcut to step into the generated code, peeling away the magic.
  • Dagger: Compile-time dependency injection for Java
    news.ycombinator.com | 2021-05-01
  • Dagger Hilt is now stable with 2.35!
    Huh, I guess this limitation will stay in for stable release after all.
  • Why Java frameworks want to support all possible many technologies instead of focusing on one thing?
    reddit.com/r/java | 2021-04-22
    Well, there's spark that from what I've saw only takes care of web stuff, you need to take another solutions for other problems (like dagger for DI).
  • Any good open source repos with Hilt?
    Assisted inject
  • Dagger Hilt is now in beta (v2.33)!
  • Patterns of Distributed Systems (2020)
    news.ycombinator.com | 2021-02-10
    I think this is a good one. Most recent Java/C# systems would have a full IoC container, but have no dynamically selected components (which is how frameworks like Dagger -https://dagger.dev/ - can exist). A lot of runtime reflection/calculation gets done for something that can be known at compile time.

Stats

Basic Dagger2 repo stats
17
16,147
9.4
7 days ago

google/dagger is an open source project licensed under Apache License 2.0 which is an OSI approved license.