This is the first time for me to write do a project using ASP.net MVC 2.0. I have some problems when I study it. One of the problems is the models and viewmodels.
In MVC model, Model class should be responsible for data processing such as manipulating database data and implementing business rules etc. Data provided by Model can be loaded to different views without considering the formatting and the looks of the view. Does it pass to view by controller? Is it right?
However, I find that the viewmodels class also contains some function likes set and get object. Moreover, it is used by controller to pass the data to the view. I think it is similar to model class.
Therefore, what is the main different between these two? And is it possible for me to draw a class diagram including both model class and viewmodel class?
Thanks for your help.
View Complete Post