-3

We are developing new Android application.

We are trying to use MVVM and Dagger 2. What are all the benefits of using Dagger 2 if we use MVVM?

1 Answers1

0

MVVM and dagger 2 are different things. Dagger 2 implements dependency injection pattern, which is really beneficial for testing, because you can test dependent classes without instantiating classes that require those dependent classes. Also makes code more readable and easy to modify later.

  • In terms of ViewModel (Arch Components wise), if you're creating ViewModel Factories is there any reason to use it? seems like the factory can be treated as a module and essentially swapped out/ mocked in that way. – 1tSurge Feb 24 '20 at 21:50