The View, the Controller

Heya everyone im back ,

fresh new year and my motivation is huge lets do this. I decided to include the View and Controller alltogether in this chapter.

There’s not much to say about the View other than it is a presentation of data in a particular format, triggered by a controller’s decision to present the data.

  • Generates the user interface which presents data to the user
  • Passive, i.e. doesn’t do any processing
  • Views work is done once the data is displayed to the user.
  • Many views can access the same model for different reasons

 

The Controller is accessed through the browser and is responsible to the following actions the user wants. It interacts with the model and displays the appropriate view to the user. The Controller is pretty much the middleman between the User’s wish and the Model and its relation to the database. It’s the coordinator and decides what HTML, CSS and JS is given out to the View , that renders the desired page.

 

To sum it all up, ‘Michael Hartl’s Rails Tutorial’s ‘ image shows it nicely:

 

Fig.: A schematic representation of the model-view-controller (MVC) architecture by “Michael Hartl’s Rails Tutorial”.

 

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s