| Aspect | True DI (Hilt) | Service Locator (Koin DSL) |
|---|---|---|
| Compile-time | Generates factory classes | Generates definition lambdas |
| Runtime lookup | Direct factory reference (type-safe graph) | Definition index by key (~0.005ms) |
| Instance creation | Runtime (via factory.get()) |
Runtime (execute lambda) |
| Missing dependency | Build fails | Runtime crash (or build fails with Annotations/Plugin) |
| Build time | Slower (annotation processing) | Faster (no KSP/KAPT) |
| Your classes | Framework-agnostic | Framework-agnostic |
Last active
January 16, 2026 23:16
-
-
Save ioannisa/9cf66fd849ac8e8b3f228023ab3b759d to your computer and use it in GitHub Desktop.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment