Layers
Unlike what ppl wrote in front of me - the MVVM template does not consist of splitting the UI layer into 3 layers, it is about splitting the UI layer into two additional layers - View and ViewModel.
therefore, if we had DAL, BLL and UI, now we have Model (DAL and BLL) and ViewModel + View (and not just one UI layer).
it's still 3 layers, but organized differently (and if you really think about it - DAL was never really a layer - it was not a helper class, so the above 3-layer was actually only 2 levels, which now become 3 layer in MVVM).
Causes
if you think about it, you'll see that in a three-layer architecture, usually the user interface is mixed with the view code and the application logic code. this violates the SRP (single responsibility principle) and is bad for several reasons. in MVVM, the UI layer is split into two layers. ViewModel, which is responsible for application logic and presentation, which is responsible exclusively for presentation.
This allows you three very important things:
best code Maintaining health.
easier to work with the constructor VS and Blend. aka Miscibility. (this is arguably the most powerful MVVM feature. It really improves performance)
allows you to test ViewModel with automatic tests, while until now we had to test the user interface itself, and automatic tests in the user interface are complicated. This is called testability.
on a personal note; I have been writing in n-level architecture for many years. I started practicing MVVM a little over a year ago. In some cases, it can be a rough trip, but man, it is really worth the effort.
source share