Decision making on when to use MVVC

This question is for cstewart or some of the more experienced developers out there:

I can tell several of the sections in the book are there to introduce readers to various concepts, and not necessarily appropriate for the simple apps that show those concepts. I think the intro that is given to the MVVC is one of those areas. This approach seems to me to introduce more (not less) complexity in app design. I have to potentially manage to keep several files “aligned” (layout(s), view model classe(s), controller class) in order to insure the “flow” of how a UI gets updated properly rather than have it “all in one place”. Can you comment more about when this approach starts to really pay off?

With BeatBox being such a simple app, I agree that MVVM feels like overkill. It’s hard to see the value when there is so much more setup code than actual code.

In Android apps that we develop through our consulting work, we now use MVVM. The thing that really clicked for me with MVVM is that it allows me to easily test important code that could not be easily tested in the past. In a real app, your activities and fragments will grow and grow. MVVM allows you to extract a large part of that code into a view model. That view model can be tested with a plain JUnit test which is pretty great.

2 Likes