I’m trying to understand a 3-layer design where MVC is (or is in) the Presentation Layer. Specifically, how would the top-down interaction concept work with respect to the Business Layer, a ViewModelBuilder, and the MVC Controller.
Should the Controller itself access the BLL?
Where does the ViewModelBuilder fit in to this?
I’m just starting to understand that the Model in MVC is actually the ViewModel rather than the Business or Persistence Model. Am I way off here?
Your confused because of the countless examples online that don’t make any distinction between a simple MVC architecture and one that is serving as only the UI layer in a larger enterprise architecture. Most likely, you need the latter.
In an application of any level of real sophistication, yes, you’ll want to think of your model classes as view models and then map them back to your domain model. Check out Automapper to help automate this.
Here’s two really good articles that were helpful to me that I think are really well written:
http://blogs.msdn.com/b/simonince/archive/2010/01/26/view-models-in-asp-net-mvc.aspx
http://blogs.msdn.com/b/simonince/archive/2010/12/07/view-model-versus-domain-entity-validation-with-mvc.aspx