MVVM Software Architecture Pattern

Why MVVM

In UI development, we can split it into 3 components as following;
  1. View (UI)
  2. Model (Business Logic and Data Displayed in UI)
  3. Glue code (Event handling, binding)
For Traditional UI development, The Model and Glue Code are being written as a part of view definition class itself. Which cause a tightly coupling between these item. 

Separation of Concerns

Here's the keyword on why we would like to use MVVM. We want to separate these component(View, Model, and Glue Code) out of each other and make it loosedly coupling between each other.

What is MVVM


MVVM is one of the pattern that attempt to make a separation of concern by isolating the glue code into it's compont called ViewModel.

The MVVM pattern includes three key parts:
  1. Model (Business rule, data access, model classes) 
  2. View (User interface (XAML)) 
  3. ViewModel (Agent or middle man between view and model)

Outline

let's see how can we implement MVVM using C#.

Reference




Deemarc Burakitbumrung

A software develper who graduated from Electronic and Communication Engineer. Have an interest in the field of programming and embedded system.

No comments:

Post a Comment