In advanced MVC implementations, what is the role of a 'ViewModel'?

  • Acts as an intermediary between the controller and the view
  • Executes business logic
  • Handles user authentication
  • Manages database connections
In advanced MVC implementations, a 'ViewModel' acts as an intermediary between the controller and the view. It contains the data and business logic needed for the view, allowing the controller to focus on handling user input and updating the model. This separation enhances code maintainability and flexibility.
Add your answer
Loading...

Leave a comment

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