MVVM and KnockOut-Way To Go


KEY NOTE : 

Hi Friends,
This is my first post on the blog and i would very much appreciate your feedback on this post and what additional topics you want me to cover.Your feedback is valuable in improving the content of this post. 

MVVM (Model-View-ViewModel)

Technology is evolving day by day and so is the way you interact with it.Lately companies are switching from WinForms to MVVM.Lets understand what you mean by MVVM

MVVM (Model-View-View Model) pattern separates code into 3 different layers: 
1) Model
2) View and
3) View Model

The concepts of Model and View are same as those described in Model-View-Controller pattern
View Model is the latest of the 3 and has promised a great deal in future web world

 
 
 

 

MVVM Pattern Relation

Model :  includes set of classes that represents data from the database
View : represents the data that is visible to the user
View-Model : it serves as the intermediate layer between the view and the view model.Data from the Model is converted into the format that the view understands…
It also handles communication between views…..

MVVM enables a great developer-designer workflow, providing these benefits:
  • During the development process, developers and designers can work more independently and concurrently on their components. The designers can concentrate on the view, and if they are using Expression Blend, they can easily generate sample data to work with, while the developers can work on the view model and model components.
  • The developers can create unit tests for the view model and the model without using the view. The unit tests for the view model can exercise exactly the same functionality as used by the view.
  • It is easy to redesign the UI of the application without touching the code because the view is implemented entirely in XAML. A new version of the view should work with the existing view model.
  • If there is an existing implementation of the model that encapsulates existing business logic, it may be difficult or risky to change. In this scenario, the view model acts as an adapter for the model classes and enables you to avoid making any major changes to the model code.

Conclusion

In my next post i will teach you what exactly knockout is and how you can use knockout for implementing MVVM pattern and leveraging several benefits of MVVM and Knockout

Advertisements
%d bloggers like this: