Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How big should your WPF app be to start using MVVM

Tags:

mvvm

wpf

Recently there have been a lot of move towards MVVM framework due to the nature of WPF development. I am making a pretty small application, which might grow a little over time. I am curious to know, what sized application should benefit from a MVVM implementation. For example .. has to have 15 user screens to be beneficial or something like that.

like image 998
Shafqat Ahmed Avatar asked Jun 15 '09 06:06

Shafqat Ahmed


2 Answers

MVVM is useful even if you have only one screen. It doesn't really depend on the size of the application, it's mainly intended to separate your UI from the logic and to help with DataBinding. Also, you'll get used to it more quickly, and you'll see it just fits with WPF perfectly no matter how big your app is.

like image 135
Botz3000 Avatar answered Nov 15 '22 09:11

Botz3000


In my opinion MVVM doesn't complicate an app, it just organizes code into separate areas. Of course there is a learning curve on how to accomplish this. In WPF there are a dozen ways to accomplish one task, so if you are unfamiliar with best practices and how WPF works it can seem very difficult. I believe to really harness MVVM you need to understand WPF. I believe the best book for that is this one. It starts at the beginning and constrasts winforms with WPF and then goes through every control type and helps you understand their role. You don't get to databinding until the middle of the book. It's a long read, but if you actually want to harness WPF and utilize MVVM I believe it's essential.

Also this sample MVVM app article is good start to understand MVVM.

like image 33
Jose Avatar answered Nov 15 '22 11:11

Jose