Saturday, 17 August 2013

Is it acceptable to have a ViewModel in MVC pattern

Is it acceptable to have a ViewModel in MVC pattern

I have recently finished a project using MVC framework (ASP.NET MVC). The
project used a separate DTO classes to be passed to View by the
controller. The model pretty much stayed away from the view. This draws a
connotation between the VM in MVVM and my DTO's. A retrospective thought
on the project suggests I could not have done without the DTO's (since, my
model is very much in Application Tier and can not be passed to Web Tier
because of security reasons).
So here is my question - Is VM (View Model) a necessity in MVC? Are there
production applications where controllers pass Model directly to the View?

No comments:

Post a Comment