In this post, we will try to discuss MVVM (Model -View-View Model) approach in application development and the reasons to follow the same. We will also try to focus the discussion in the context of application development for process industries. Although the discussions may be applicable to any application development process.
For a certain application development(especially for process industries) there are mainly two aspects. First is the domain knowledge (or problem areas with solution) which needs to be converted into a software solution (You can call them Model) and the second is an interface provided to the user to interact with that model( which is known as View). Now the teams working on any project may have members having expertise in their respective domains. One team could comprise of domain experts (with assumed no prior knowledge of application development) and application developer ( who are expert in converting the domain knowledge to a software solution AKA “model”), while another team could be UI (User Interface) designers. Synergy of both team is utmost important for the success of software in the industry. Many more issues come forward when you are doing any project with a group of diversified portfolio e.g. Business Logic maintenance, providing abstractions, code maintenance.
Under such circumstances the concept of SOC (Separation of Concerns) comes handy. We must try to separate the aim of each individual part of a project. In this context MVVM approach can be used. As in my blogs , i am trying to focus on application development using Microsoft technologies, we will restrict ourselves to follow MVVM pattern in WPF & Silverlight application development but the approach can be tweaked to suit your requirement using any development platform.
Although, at the beginning following such standard patterns might seems as overhead especially under deadline pressures, but in the long term benefits are immense in terms of maintainability, development & testing time etc.As model sand views will be separated, programmers as well as designers can do their work simultaneously and thus leading to reduced development time. Also , unit testing become more easy and feasible if you follow such separation.Few of the benefits are listed below :
- Concurrent process and UI development thus reduced development time
- Better Unit testing
- Efficient code maintenance
- Provide efficient abstraction levels
- Better error handling mechanism
The process to follow such patterns might now be as intuitive at first glance, but once you are adapt to such development paradigms it will be in fact much more convenient and will look much more obvious and robust.
We will try look at the rules, techniques to achieve the MVVM pattern in subsequent blogs.