What is MVVM? and Why MVVM?

2. March 2011

 

 

What is MVVM?

    Model-View-ViewModel (aka Presentation Model), provides architectural solution for the Aplication with UI with complex interdependent interactions.

    Separate the UI(View) from the UI logic using a ViewModel that encapsulates the interactions and provides properties for a View to retrieve its state (and the state of its elements). 

 

Why MVVM?

1. Separates UI from Model. If model needs to change, it can without changing the view and vice versa.

2. Avoids duplicated code to update views.

3. Unit testable UI logic.

4. You can use a 'viewmodel' to aggregate parts of your model that exist in separate classes/libraries to facilitate a more fluent interface for the 'view' to deal with.

5. Data-binding support with INotifyPropertyChanged, ICommand and IvalueConverters

6. Easy to refactor

7. Extensibility.

 

interview questions, .Net, wpf ,

blog comments powered by Disqus