I'm currently working on a Enterprise WPF LOB Desktop application using the MVVM design pattern. My current Solution structure in my development machine is the following:
- Main Project - WPF application containing all the Views (XAML)
- View Model - Contains all View Models backing up the Views in main project
- BLL - Business Logic Layer
- DAL - Data Access Layer - Connects to a MS-SQL server and calls Stored Procedures
- Model - Contains all business entities
I'm currently not using WCF since everything resides in the same machine at this moment except the database which is in its own server. However, in the future we are planning to split the code-base into 3-tiers.
The problem I have is that one colleague insists that we should split our application as follows in 3 separate servers/machines:
- Presentation Tier - The client WPF application (View) in users machine. This may as well be a Web client application
- Logic Tier server - The View Model + Model + Business Logic Layer + Data Access Layer
- Data Tier server - The database server
I cannot conceive the View Model living apart(different server) from the View and he claims that should be possible.
EDIT: My colleague claims that having the View Model in the Server side will ease any future deployments and will make it more maintainable because changes would go only on the server side. However, I've deployed .NET applications using ClickOnce and it is not really a big deal.
From what I have read you can have a WPF client application installed at users computer which contains the View and ViewModel and then expose the services at lower layers through a communication layer like WCF.
This answer in another posts states the following: "In MVVM the UI Layer is separated into two layers. the ViewModel, which is in charge of the Application Logic, and the View, which is in charge solely on presentations." Based on that, my fundamental question is, can the View and the ViewModel UI layers reside in separate tiers (servers)? If so, is that recommended? and how could that be accomplished?
Thanks!