Common problems with MVVM apps
Those few who have read my blog before might remember me raving about the combo Fody.PropertyChanged + MVVMCommand. I was pretty excited to get some good comments on that post and it is really the comments that are the reason I am writing this post.
App logic is distributed and disconnected
This is the main point really and the other two are a consequence of it - there is no central app object or a system which controls the flow and holds the state of the app.
Too much logic and responsibilities in the
Since app logic has no special home it is spread over
viewsview models. Those are fetching data from services and transforming it to their own structure, doing navigation to other views, etc. These extra responsibility only make changing the flow of the app and reusing the views more difficult. I am talking about view models like this, this and this one. In my opinion viewsview models should receive data, take care of the user interactions in the view and send out notifications/actions with the data the user has submitted. Here is a link to a blog post by Adam Kemp that goes in detail about decoupled views.
Not good enough testing of the behaviour of the app due to issues described in the previous two points
Testing of the app is limited to testing individual
viewsview models, it is quite hard to test the flow of the app unless you are up for setting up a lot of infrastructure and usually plenty of mocking.
MVVM frameworks that are on the market either (inadvertently) support these design shortcomings (dependency injection containers make it super easy to get all kinds of services in the view model with minimal effort) or at best do not address them at all. To be fair these frameworks are mostly trying to smooth out the MVVM pattern and are not trying too hard to advise you on app architecture but their samples are doing that in a way.
So back to those comments mentioned earlier.
I wrote I am going to write my idea of a good mobile app and I would like to show you what I have been up to. Coming up real soon ;)
UPDATE: fixed broken links to the examples