Adam Hurwitz
1 min readMay 13, 2017

--

I have adjusted my repository to make it a protected variable. Great idea!

The MainViewModel is not required in this example. I included it in order to have a clear separation between the view logic in the Activity and the “Business logic” in the MainViewModel. Per your suggestion, passing in the repository into the MainViewModel; the reason I’m injecting the repository in the MainViewModel is to keep the “Business logic” apart from the UI in the MainActivity.

--

--

Adam Hurwitz

An account about nothing | Researcher and product consultant