DivineRails

Ruby on Rails

Blog

MVC Architecture

Posted by Rq Bukhari on January 24, 2012 at 6:55 AM




MVC architecture is a software architecture used in software engineering. Ruby on rails uses MVC (Model, View, Controller) architecture. The MVC architecture of ruby on rails make it easy to keep the code DRY and makes clear where different types of code belongs. This makes the maintenance of code easy.



DRY is a principal of ruby on rails web development that suggest to not repeat a code again and again. DRY is "Don't Repeat Yourself" which means repeating same code again and again is a bad thing.



MODELS


Model represents the information of application. A model corresponds to a table in the database. It defines the rules to manipulate data.



VIEWS


Views are the user interface of application. Views provides data to the web browsers and other tools that are used to make request from an application. Views are the HTML file with embedded ruby code.



CONTROLLERS


Controllers receives the user input. In ruby on rails controllers are responsible for processing the incoming requests of the web browsers and other tools, interrogating the models for required data and passing the data to views for presentation.


This is a short explanation of MVC architecture. To study ruby on rails and MVC Architecture Click here.


Categories: None

Post a Comment

Oops!

Oops, you forgot something.

Oops!

The words you entered did not match the given text. Please try again.

Already a member? Sign In

3 Comments

Reply Rehmat Qadir
8:50 AM on January 24, 2012 
Hi..
Very nice and simple explanation of MVC. Thanks for sharing you knowledge with us.
Reply abid
5:54 AM on February 2, 2012 
Nice explanation dude.....
Reply Rq Bukhari
5:57 AM on February 2, 2012 
abid says...
Nice explanation dude.....


Thank you so much Admin. I hope good posts from you soon. Kindly share your knowledge with us. :)