consider a mvvm/wpf application, what advantage has it to do for example 3 projects (View, ViewModel, Model) in a visual studio solution?
Asked
Active
Viewed 244 times
1
-
3compared to ..., and don't say "not doing it". Compared to everything in one solution, or 3 different solutions? – Lasse V. Karlsen May 15 '10 at 20:55
-
Or compared to running these on 3 different machines? – Hans Passant May 15 '10 at 21:05
-
1The answer depends on what you compare them to. – sbi May 15 '10 at 21:21
1 Answers
0
I can't think of any real advantage to splitting your view, viewmodel and model into separate projects, unless they are large and you need better organization or you would like to compile them to dlls that can be versioned independently.

Eric Mickelsen
- 10,309
- 2
- 30
- 41
-
well I have just read doing MVVM pattern separating the View from the ViewModel as different projects should be best...? – msfanboy May 15 '10 at 21:32
-
People writing on MVVM will often suggest it, but also note that it's not really necessary, e.g. http://msdn.microsoft.com/en-us/magazine/dd458800.aspx. It may have the couple of advantages I noted, but putting them in one project won't really hinder your implementation of MVVM. Just use the same criteria for splitting code into projects that you normally would. – Eric Mickelsen May 15 '10 at 21:37
-
well what are the criterias for splitting my code into several projects independent from mvvm? – msfanboy May 16 '10 at 20:55
-
Mainly the two I stated in my answer. It's pretty much the same thinking as when you decide how to organize your classes and code blocks in source files. You have to make logical divisions and try to maintain a nice balance between the number of parts and the sizes of those parts. You want to avoid huge projects for the sake of compilation time, loading time, reusability and sheer overwhelming complexity. At the same time, too many projects also means over-complication and each project will have a gazillion references that make your dependencies impossible to keep track of. – Eric Mickelsen May 17 '10 at 16:43