# evant/kotlin-inject

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/evant-kotlin-inject).**

_How this analysis was created: the description and tags below were written by an AI model that read this project's README and public documentation pages; stars, license and language come straight from the GitHub API. The model does not read the source code._

1,503 stars · 73 forks · Kotlin · Apache-2.0

## Links

- GitHub: https://github.com/evant/kotlin-inject
- awesome-repositories: https://awesome-repositories.com/repository/evant-kotlin-inject.md

## Topics

`dependency-injection` `kotlin`

## Description

Kotlin-inject is a dependency injection framework for Kotlin that utilizes compile-time code generation to construct type-safe object graphs. By processing declarative annotations during the build process, the library eliminates the need for runtime reflection, ensuring that dependency resolution and validation occur before the application executes.

The framework distinguishes itself through its native support for Kotlin Multiplatform, enabling consistent dependency management across shared and platform-specific codebases. It provides specialized mechanisms for assisted injection, allowing developers to combine injected services with runtime parameters, and supports hierarchical component composition to manage object lifecycles and state across different architectural layers.

The library covers a broad range of configuration and lifecycle management capabilities, including lazy initialization, circular dependency resolution, and the ability to substitute production implementations with mocks during testing. It also integrates directly with user interface frameworks to supply state and services, while allowing for variant-specific configurations to adapt to different build environments.

## Tags

### Software Engineering & Architecture

- [Compile-Time Dependency Injection Frameworks](https://awesome-repositories.com/f/software-engineering-architecture/compile-time-dependency-injection-frameworks.md) — Provides a compile-time dependency injection framework for Kotlin that constructs type-safe object graphs without runtime reflection.
- [Compile-Time Code Generation](https://awesome-repositories.com/f/software-engineering-architecture/compile-time-code-generation.md) — Validates dependency graphs and generates factory logic during the build process to eliminate runtime initialization overhead.
- [Dependency Resolution](https://awesome-repositories.com/f/software-engineering-architecture/dependency-resolution.md) — Provides type-safe dependency resolution by processing declarative annotations at compile time.
- [Hierarchical State Composition](https://awesome-repositories.com/f/software-engineering-architecture/architectural-design-patterns/state-management/centralized-state-containers/state-containers/hierarchical-state-composition.md) — Enables hierarchical component composition to manage object lifecycles across different application layers.
- [Application Component Lifecycles](https://awesome-repositories.com/f/software-engineering-architecture/component-lifecycle-management/application-component-lifecycles.md) — Controls object creation and destruction by scoping lifetimes to specific components or states.
- [Dependency Injection Libraries](https://awesome-repositories.com/f/software-engineering-architecture/cross-platform-development/multiplatform-code-sharing/dependency-injection-libraries.md) — Automates the creation of platform-specific factory functions across shared and target source sets to bridge common and platform-specific code. ([source](https://github.com/evant/kotlin-inject/blob/main/docs/multiplatform.md))
- [Multiplatform Factory Generators](https://awesome-repositories.com/f/software-engineering-architecture/cross-platform-development/multiplatform-code-sharing/multiplatform-factory-generators.md) — Produces platform-specific factory code from shared definitions to maintain consistent dependency management.
- [Dependency Injection Hierarchies](https://awesome-repositories.com/f/software-engineering-architecture/dependency-injection-hierarchies.md) — Enables modular architecture by nesting component hierarchies to share dependencies. ([source](https://github.com/evant/kotlin-inject/blob/main/README.md))
- [Dependency Injection Providers](https://awesome-repositories.com/f/software-engineering-architecture/dependency-injection-providers.md) — Resolves dependencies directly into user interface components by providing state and services. ([source](https://github.com/evant/kotlin-inject/blob/main/docs/android.md))
- [Object Lifecycle Management](https://awesome-repositories.com/f/software-engineering-architecture/dynamic-object-instantiation/object-lifecycle-management.md) — Groups dependencies within specific lifecycles or named scopes to control object sharing and automatic resource cleanup. ([source](https://github.com/evant/kotlin-inject/blob/main/CHANGELOG.md))
- [Annotation-Based Injection](https://awesome-repositories.com/f/software-engineering-architecture/integration-extensibility/dependency-injection/annotation-based-injection.md) — Uses declarative annotations to define component hierarchies, scoped lifetimes, and assisted injection factories.
- [Assisted Injection Systems](https://awesome-repositories.com/f/software-engineering-architecture/integration-extensibility/dependency-injection/assisted-injection-systems.md) — Supports factory interfaces for classes requiring both injected services and runtime parameters. ([source](https://github.com/evant/kotlin-inject/blob/main/CHANGELOG.md))
- [Dependency Graph Construction](https://awesome-repositories.com/f/software-engineering-architecture/integration-extensibility/dependency-injection/dependency-graph-construction.md) — Provides mechanisms to declare abstract components that automatically generate dependency injection logic. ([source](https://github.com/evant/kotlin-inject/blob/main/README.md))
- [UI Component Injection](https://awesome-repositories.com/f/software-engineering-architecture/integration-extensibility/dependency-injection/ui-component-injection.md) — Supplies state and services directly into user interface components to simplify data flow.
- [Assisted Injection Interfaces](https://awesome-repositories.com/f/software-engineering-architecture/software-architecture/architectural-patterns/modular-decoupled-design/factory-pattern-interfaces/assisted-injection-interfaces.md) — Supports assisted injection interfaces to combine injected services with runtime parameters.
- [Testability Optimizations](https://awesome-repositories.com/f/software-engineering-architecture/testability-optimizations.md) — Facilitates testable software design by allowing production implementations to be substituted with mocks during the testing lifecycle.

### Development Tools & Productivity

- [Compile-Time Dependency Resolution](https://awesome-repositories.com/f/development-tools-productivity/compile-time-dependency-resolution.md) — Constructs type-safe object graphs during compilation to eliminate runtime overhead. ([source](https://github.com/evant/kotlin-inject/blob/main/CHANGELOG.md))
- [Dependency Qualifiers](https://awesome-repositories.com/f/development-tools-productivity/dependency-injection-type-hinting/dependency-qualifiers.md) — Uses qualifiers or type aliases to distinguish between multiple instances of the same type. ([source](https://github.com/evant/kotlin-inject#readme))
- [Lazy Providers](https://awesome-repositories.com/f/development-tools-productivity/dependency-resolution/lazy-providers.md) — Wraps dependencies in functional providers to defer object construction until access.
- [Lazy Initialization](https://awesome-repositories.com/f/development-tools-productivity/lazy-initialization.md) — Delays the creation of heavy objects until required to reduce startup time and memory usage. ([source](https://github.com/evant/kotlin-inject#readme))

### Programming Languages & Runtimes

- [Kotlin Multiplatform DI](https://awesome-repositories.com/f/programming-languages-runtimes/kotlin-multiplatform-di.md) — Enables consistent dependency management across shared and platform-specific codebases in Kotlin Multiplatform projects.

### Part of an Awesome List

- [Multiplatform Libraries](https://awesome-repositories.com/f/awesome-lists/devtools/kotlin-libraries/multiplatform-libraries.md) — Supports shared code across Android, iOS, and desktop targets through platform-specific code generation.

### Testing & Quality Assurance

- [Dependency Mocking](https://awesome-repositories.com/f/testing-quality-assurance/software-testing/dependency-mocking.md) — Replaces production implementations with test-specific mocks by injecting custom configurations during the test lifecycle. ([source](https://github.com/evant/kotlin-inject/blob/main/docs/testing.md))
