Thursday, 22 September 2016

Model View Controller


MVC - MVC is a programming paradigm used extensively worldwide as a standard architectural pattern for software development.
The purpose of MVC architecture is to hide business logic from user interface. MVC comprises of Model View and Controller.

Model - Business logic layer
All the business logic of your application and Interaction to database goes here. It comprises of queries and business rules of application.

View - Presentation Layer
It accepts request from user and renders the result. It acts as bridge between user and application.

Controller - Control Layer
It acts as a bridge between Model and View. It accepts request from user, manipulate it to fetch or update data in database using respective model and finally renders result on respective view page.


History (courtesy - wikipedia.org)

Trygve Reenskaug introduced MVC into Smalltalk-76 while visiting the Xerox Palo Alto Research Center (PARC) in the 1970s. In the 1980s, Jim Althoff and others implemented a version of MVC for the Smalltalk-80 class library. Only later did a 1988 article in The Journal of Object Technology (JOT) express MVC as a general concept.

The MVC pattern has subsequently evolved, giving rise to variants such as hierarchical model–view–controller (HMVC), model–view–adapter (MVA), model–view–presenter (MVP), model–view–viewmodel (MVVM), and others that adapted MVC to different contexts.