Understanding the MVC Pattern

The easiest way to get a handle on MVC is to use it in a framework that enforces it, that being said..

  • The Model interacts with the datasource (DB or whatever) and gives you access to your data.
  • The View interacts with the outside world, it receives input from somewhere and hands off the data to the Controller it also listens to the Controller to make sure its displaying the correct data.
  • The Controller is where all the magic happens; the Controller manipulates data, pushes events, and handles changes in both directions (to/from the View and to/from the Model).

This diagram is very helpful (it makes much more sense than Wikipedia’s):
MVC Diagram

Source, and a great article on MVC!

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)