Minimalist Dependency Injection in Kotlin
summary
Aleksei’s injector is a lightweight Kotlin service‑locator that uses delegated properties to deliver dependencies lazily, explicitly avoiding no reflection or code generation, and it wires modules into a single monolithic injector at app start. It implements scoped lifecycle with start/stop so scoped instances are cached per active scope and cleaned up when stopped, exposes a checkInjector validation method to fail a single integration test for missing bindings, and supplies a mock injector for unit tests so injected fields can be replaced and verified.
AI-written summary · about
chapters (14)
- 0:00Introduction to Injector
- 1:55What is Injector
- 3:42Basic Usage Demo
- 5:09Dependency Resolution
- 6:13Scope Management
- 7:18Scoped Instances
- 8:04Validation and Testing
- 9:31Configuration Checks
- 10:14Unit Testing Injected Classes
- 11:40How Injector Works
- 13:54Providers and Bindings
- 14:42Design Principles
- 16:30Configuration Correctness
- 16:54Q&A








