I'm currently introducing Prism to a new Wpf application, and am using the MVVM pattern. My initial approach of structuring the Wpf application was to add one project to hold the model classes, one to hold the viewmodel classes, etc. These might be split at a later time to avoid having different logical components in the same project. However, this strikes me as a bad structure when using Prism (and parhaps in general..).
In Prism you want to structure things into different logical modules - where anything related to the same things would be placed in the same module. So this tells me I should put all related to a logical part of my application into a module for this part. This might hold some different views for this component, the related view model, and the necessary model classes. Using this approach I would however get the model scattered around my solution. As the model will be tied to a database this strikes me as a possibly bad approach after all. I am using NHibernate, so the database won't really be that "visual" though.
So I see three different structures. Are any of these typically desired? Or is there a different way I should structure my application?
- Projects "Model", "ViewModel", and also one to hold UserControls. Etc..
- One project pr logical part - including both related view, viewmodel and model for this part.
- One project pr logical part - including view and viewmodel, but the model being defined in a separate project. Maybe even one project for all model classes if they have a logical relationship.
Any opinions are greatly appreciated!