Please explain what is MVC and why do we use it?
Submitted by: MuhammadMVC stands for Model View Controller.
Model is the data structure that your program uses.
The View is the part that interacts with the screen or the next level up.
The Controller generally processes data between the model and view.
For example, a model will define your table in the database, the controller will dictate what to do behind the scenes and what to display in the view next. The view part generates the user interface which presents data to the user.
Let's take an example of creating a form. The submit form will be a view file, from that view file, when you click on the submit button it goes to the respective controller where you have written your business code about what happens on submitting the application/form, and from that controller the data will be saved in the database.
Thus MVC helps to split up the the business logic, database access and presentation. This is very useful in most web applications, and now lately into software/desktop applications.
Submitted by: Muhammad
Model is the data structure that your program uses.
The View is the part that interacts with the screen or the next level up.
The Controller generally processes data between the model and view.
For example, a model will define your table in the database, the controller will dictate what to do behind the scenes and what to display in the view next. The view part generates the user interface which presents data to the user.
Let's take an example of creating a form. The submit form will be a view file, from that view file, when you click on the submit button it goes to the respective controller where you have written your business code about what happens on submitting the application/form, and from that controller the data will be saved in the database.
Thus MVC helps to split up the the business logic, database access and presentation. This is very useful in most web applications, and now lately into software/desktop applications.
Submitted by: Muhammad
Read Online Ruby Developer Job Interview Questions And Answers
Top Ruby Developer Questions
☺ | Tell us what is class libraries in Ruby? |
☺ | Tell me can you call a private method outside a Ruby class using its object? |
☺ | Explain me what is the function of ORM in Ruby on Rails? |
☺ | Tell me the role of modules and mixins in Ruby? |
☺ | What is the difference extend and include? |
Top Web Developer Categories
☺ | Bootstrap Interview Questions. |
☺ | Front End Web Developer Interview Questions. |
☺ | Typography Interview Questions. |
☺ | Laravel PHP Developer Interview Questions. |
☺ | Junior Developer PHP Interview Questions. |