What Is Model-View-Controller (MVC)?
by, 04-26-2012 at 08:40 PM (558 Views)
In past years if you have done programming with the libraries of GUI then you must would have come across the MVC design i.e model view controller design. It was firstly introduced by the Trygve Reenskaug who was a developer at XPAR (Xerox Palo Alto Research Center ) in 1979. He used to decouple the business logic and data access , in a manner which then is displayable to the user.MVC consists of 3 basic elements, which are given below:
• Model - Rules and the data are presented by this model who gover the data updates and also govern the access of the date. Model usually serves to be a software approximation, of process of a real world.
• View - Model contents are rendered by the view. Exactly it is been shown that how data of model can be represented. If the model data gets changed then presentation of the view shall get updated. This could only be done by push model where view is registered with model, for change notifications. Or, pull method could be used where view is totally responsible for method calling when current data is needed to be retrieved.
• Controller -Interactions of the users are translated by the controller into those actions which will be performed by the model. In case of GUI client who stand alone, user interactions might be menu selections or button clicks. However in case of web applications, they will be appearing as POST HTTP or GET requests. It depends upon the context that a new view might be selected. For example, result’s web page for presenting to users.