Model-View-Controller(MVC) was introduced by Smalltalk's inventors (TrygveReenskaug and others) is really a software architecture pattern which separates the modeling of the domain, the presentation, and the actions based on User input in to three separate classes.




This includes application data, business rules, logic, and functions. It controls the behavior and information of the application domain, responds to requests for details about their state (usually from the view), and responds to instructions to alter state (usually from the controller). A model notifies their associated views and controllers when there is a change in their state. This notification allows the views to produce updated output, and the controllers to change the available set of commands.


The view controls the User Interface.


It presents the classes connecting the model and the view, and is used to communicate between classes in the model and view. The Controller controls the user requests (received as HTTP GET or POST requests when the user presses on GUI things to execute actions). Its major function is always to call and coordinate the necessary resources/objects needed to execute the user action. Usually the control can call the appropriate model for the task and then chooses the appropriate view.