Setter Injection?
#229
-
Is it possible to inject dependencies into fields and not through the constructor? For example, in the same activity or fragments without factories, or is this option not supported? |
Beta Was this translation helpful? Give feedback.
Answered by
evant
Aug 23, 2022
Replies: 1 comment
-
This is intentionally not supported because it allows objects to be in a partially constructed state. I have some guidance for android specifically since it does use the pattern where you don't control construction a lot which is unfortunate. https://github.com/evant/kotlin-inject/blob/main/docs/android.md |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
denchic45
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is intentionally not supported because it allows objects to be in a partially constructed state. I have some guidance for android specifically since it does use the pattern where you don't control construction a lot which is unfortunate. https://github.com/evant/kotlin-inject/blob/main/docs/android.md