Model, View and Controller in MVC3
The Model-View-Controller (MVC) pattern separates the modeling of the domain, the presentation, and the actions based on user input into three separate classes :
Model :
- Model is the representation of your data.
- It contains Business Logic.
- The model manages the behavior and data of the application domain, responds to requests for information about its state (usually from the view), and responds to instructions to change state (usually from the controller).
View :
- The view manages the display of information.
- No Code behind
- Action methods by default call views with the same name.
- Views are not tied to a specific action method or controller.
- Views should be dumb, should not contain any application logic. It only contains rendering logic.
- Views can be strongly typed.
Controller :
- The controller interprets the mouse and keyboard inputs from the user, informing the model and/or the view to change as appropriate.
- The Controller prepares the data with the help of model and informs View Engine to render which view.
0 comments:
Post a Comment