awesome-repositories.com
博客
awesome-repositories.com

通过 AI 驱动的搜索,发现最优秀的开源仓库。

探索精选搜索开源替代品自托管软件博客网站地图
项目关于排名机制媒体报道MCP 服务器
法律隐私政策服务条款
© 2026 Bringes Technology SRL·VAT RO45896025·hello@awesome-repositories.com
·
square avatar

square/daggerArchived

0
View on GitHub↗
7,281 星标·3,076 分支·Java·Apache-2.0·4 次浏览square.github.io/dagger↗

Dagger

Dagger is a compile-time dependency injection framework for Java and Android that automates object creation and lifecycle management. It functions as a static dependency injector and graph validator, resolving object requirements during the build process to avoid runtime reflection and prevent crashes caused by missing bindings.

The framework distinguishes itself by using static analysis and code generation to produce factory classes at build time. It employs qualifier-based type differentiation to manage multiple implementations of the same type and provides scope-based lifecycle management to control object longevity, such as shared singletons or lazy initialization.

The system covers a broad range of capabilities including automated dependency provisioning through annotated constructors, component binding management via modules, and the ability to override bindings with mocks for isolated unit testing. It further supports static field injection and the mapping of types to specific implementations.

Features

  • Static Injection Frameworks - Implements a Java-based dependency injection framework that uses compile-time code generation instead of reflection.
  • Dependency Injection - Automates the creation and delivery of object dependencies through a compile-time dependency injection framework.
  • Static Dependency Resolution - A framework that resolves object dependencies during the build process to avoid expensive runtime reflection.
  • Static Dependency Resolution - Determines object requirements by analyzing source code at build time instead of searching memory at runtime.
  • Android Dependency Management - Automates the creation and delivery of object dependencies specifically within Android applications.
  • Dependency Mapping - Maps dependencies by scanning Java annotations to determine the required implementation types at compile time.
  • Dependency Injection - Instantiates and delivers required objects to classes by resolving complex dependency graphs.
  • Automated Object Delivery - Reduces manual boilerplate by automating the creation and delivery of object dependencies throughout the application.
  • Factory Generators - Generates Java factory classes at build time to instantiate objects without using runtime reflection.
  • Object Lifecycle Management - Controls whether dependencies are created as singletons, initialized lazily, or instantiated fresh for every request.
  • Graph Validation - Analyzes the dependency graph during compilation to detect missing bindings or circular dependencies.
  • Service Lifetime Scopes - Manages object longevity through scope definitions like singletons or activity-level caches.
  • Dependency Scopes - Controls object longevity by supporting shared singletons, lazy initialization, or fresh instances for every request.
  • Custom Binding Definitions - Provides a mechanism to define dependencies for interfaces or third-party classes using provider methods.
  • Dependency Qualifiers - Uses qualifier annotations to distinguish between multiple implementations of the same type.
  • Interface-to-Implementation Bindings - Maps abstract interfaces to concrete class implementations and supports contributing multiple values to set bindings.
  • Java Application Architecture - Manages complex object graphs and class lifecycles in Java projects to improve modularity and testability.
  • Compile-Time Validators - Verifies the integrity of the dependency graph during the build process to ensure all bindings are satisfied.
  • Binding Replacements - Enables replacing production implementations with substitute objects or mocks for isolated unit testing.
  • Unit Testing - Supports isolating components during testing by replacing production implementations with mocks.
  • Dependency Injection - Fast, compile-time dependency injection for Java and Android.
  • Developer Utilities - Dependency injection framework for Java and Android.
  • ProGuard Configurations - Provides dependency injection configuration rules.

Star 历史

square/dagger 的 Star 历史图表square/dagger 的 Star 历史图表

AI 搜索

探索更多 awesome 仓库

用简单的语言描述您的需求 —— AI 将根据相关性为您从数千个精选开源项目中进行排序。

Start searching with AI

常见问题解答

square/dagger 是做什么的?

Dagger is a compile-time dependency injection framework for Java and Android that automates object creation and lifecycle management. It functions as a static dependency injector and graph validator, resolving object requirements during the build process to avoid runtime reflection and prevent crashes caused by missing bindings.

square/dagger 的主要功能有哪些?

square/dagger 的主要功能包括:Static Injection Frameworks, Dependency Injection, Static Dependency Resolution, Android Dependency Management, Dependency Mapping, Automated Object Delivery, Factory Generators, Object Lifecycle Management。

square/dagger 有哪些开源替代品?

square/dagger 的开源替代品包括: google/guice — Guice is a Java dependency injection framework and component container. It automates object wiring by mapping… google/dagger — Dagger is a compile-time dependency injection framework for Java and Android applications. It automates the… insertkoinio/koin — Koin is a dependency injection framework for Kotlin applications that manages object lifetimes and resolves… uber-go/fx — Fx is a dependency injection framework and application lifecycle manager for Go. It functions as a component model… excilys/androidannotations — AndroidAnnotations is a boilerplate generator and component annotation library designed for Android development. It… inversify/inversifyjs — InversifyJS is an inversion of control framework and dependency injection library for TypeScript. It provides a…

Dagger 的开源替代方案

相似的开源项目,按与 Dagger 的功能重合度排序。
  • google/guicegoogle 的头像

    google/guice

    12,734在 GitHub 上查看↗

    Guice is a Java dependency injection framework and component container. It automates object wiring by mapping interfaces to implementations via a central injector, removing the need for manual factory patterns and constructor calls. The framework provides specialized support for aspect-oriented programming, allowing for the interception and modification of method execution to implement shared cross-cutting concerns. It also functions as a persistence manager to coordinate transaction boundaries and manage the lifecycle of entity managers within a dependency-injected environment. Its core cap

    Java
    在 GitHub 上查看↗12,734
  • google/daggergoogle 的头像

    google/dagger

    17,697在 GitHub 上查看↗

    Dagger is a compile-time dependency injection framework for Java and Android applications. It automates the construction and wiring of object graphs by generating static source code during the build process, which eliminates the need for reflection or runtime bytecode generation. The framework distinguishes itself by performing strict validation of the entire dependency structure before the application runs, ensuring that all required bindings are satisfied and identifying circular references early. It manages object lifecycles through scoped containers and supports lazy resolution, allowing

    Java
    在 GitHub 上查看↗17,697
  • insertkoinio/koinInsertKoinIO 的头像

    InsertKoinIO/koin

    9,992在 GitHub 上查看↗

    Koin is a dependency injection framework for Kotlin applications that manages object lifetimes and resolves dependencies through a lightweight container. It functions as a multiplatform library, allowing shared object definitions and resource bindings to be reused across different target platforms and source sets. The framework provides a system for resolving dependencies directly within user interface components to decouple business logic from view implementations. It includes a compile-time dependency validator that analyzes dependency graphs during the build process to detect missing bindi

    Kotlinandroiddependency-injectioninjection
    在 GitHub 上查看↗9,992
  • excilys/androidannotationsexcilys 的头像

    excilys/androidannotations

    10,981在 GitHub 上查看↗

    AndroidAnnotations is a boilerplate generator and component annotation library designed for Android development. It functions as a dependency injection framework that uses custom annotations to automate the wiring of activities, fragments, and services. The project focuses on reducing manual plumbing through the automation of Android boilerplate. It provides automated solutions for dependency injection and view binding, removing the need for repetitive calls to locate UI elements or manually write factory classes. The library covers activity lifecycle management and the generation of standar

    Java
    在 GitHub 上查看↗10,981
  • 查看 Dagger 的所有 30 个替代方案→