You want to separate all your business logic and data validation in a model. This usually involves βgroupingβ the data sets and such or filtering the data according to some criteria.
You want to separate all the calls to these model methods in the controller, who is responsible for extracting and sending data to and from the model. The controller then passes the appropriate data type to the view.
Helpers are the logic that a view uses to represent presentation logic (not business logic or validation), such as the print menu, etc.
In the view, you will use Helpers (or not, they are not required to use MVC correctly, but they "help": p) to write HTML, CSS and JS in the browser. You can also separate commonly used viewers with partial views, which you can include in more than one view.
You can further split things up into a ViewModel, but then you go beyond the "strict" MVC. In this case, you should use the ViewModel to help interact with the model - basically, the ViewModel is a modular controller. In this case, the controller will do much less than little.
However, this is usually too large for web applications. Since web applications have one thread of execution (request) sharing things in the ViewModel, it becomes unnecessary. However, in the GUI code, ViewModel becomes much more useful (since graphical interfaces have much more than one thread of execution).
You always want to divide the business logic into a model, a period. Remember that you should not associate a controller with your model - so that you can use your model elsewhere on other controllers or even expose it as a web service.
Hope this helps :)
source share