You've been reading about the MVC architecture and are trying to understand the components. If you wanted to add logic to fetch data from a database when a user visits a certain page, which component of MVC would handle this?

  • Model
  • View
  • Controller
  • Middleware
In the MVC (Model-View-Controller) architecture, the 'Model' component handles data-related logic, such as fetching data from a database. It represents the application's data and business logic. The 'Controller' handles user input and coordinates the flow of data between the 'Model' and 'View' components.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *