O'Reilly logo
  • Ryan Garrett thinks this is interesting:

It is important to differentiate between processing data and formatting it. Views format data, which is why I passed the Product object in the previous section to the view, rather than formatting the object's properties into a display string. Processing data–including selecting the data objects to display–is the responsibility of the controller, which will call on the model to get and modify the data it requires. It can sometimes be hard to figure out where the line between processing and formatting is, but as a rule of thumb, I recommend erring on the side of caution and pushing anything but the most simple of expressions out of the view and into the controller.


Cover of Pro ASP.NET MVC 5, Fifth Edition


Distinction: Views format data, view models provide it, controllers find the correct models/view models