Retrieve Photo in ViewModel | raywenderlich.com


This is a companion discussion topic for the original entry at https://www.raywenderlich.com/7042416-dependency-injection-with-koin/lessons/17

@kevindmoore here constructor injection isn’t the preferred approach instead of field injection? Please tell us a little more about that difference in Android context.

That is one of the beauties of Koin. You can use it for fields as well. It can be used for constructor injection but then you would need a ViewModelFactory class. This way we avoid the need for a factory class.

1 Like