How to Dramatically Improve Testability for Mobile App Development – Part 2

How to Dramatically Improve Testability for Mobile App Development

Part 2: Realizing the Benefits of MVVM

In Part 1 of this series, I discussed the limitations of the MVC design pattern as related to testing.  Having used the MVVM design pattern for desktop applications for many years, Syncro Medical is now using MVVM for its mobile app projects with great success.  In this blog, I’ll further explain MVVM, and why it’s a much better solution for testing mobile applications.

What is the MVVM Pattern?

MVVM stands for Model-View-ViewModel. It is a design pattern that was created by Microsoft architects to be used with the WPF framework. WPF is well suited for this design pattern and in fact, seems to have been created for it. As the MVVM pattern gained popularity in the desktop world, it has also started to gain support in other platforms such as Android and iOS.  And for good reason.

The main difference between the MVVM and MVC pattern is that while the MVC’s Controller is tightly coupled to the View layer, MVVM’s ViewModel is not aware of the View layer at all. The MVC Controller knows about both the View and Model layers and is responsible for shuttling data and commands between those layers. By contrast, MVVM’s ViewModel is only responsible for interacting with the Model layer to provide the data and workflow logic needed by the UI. The MVVM’s View layer is a little more active than the MVC’s View because it contains a data-binding mechanism that is responsible for mapping the data from the ViewModel’s properties to the View’s widgets.

Pages: First |1 | 2 | 3 | ... | Next → | Last