MVC

MVC Chapters

Introduction

What is MVC

The Model-View-Controller (MVC) is an methodology or architectural pattern that separates an application into three main logical components: the model, the view, and the controller.

All the three components are interconnected with logical grouping of related actions with each other to separate internal representations of information.

When a client browser sends a request. It is intercepted by controller component in the server which wills in decide to dispatches the request to the model. Model component interacts with the database if necessary and executes the programmatic logic and sends the response to view component which in turn sends the response to the browser.

Note: The View is not allowed to change the state of the model directly but can only be done through the Controller.

 

For any further quires do write us to madhusudan@javaconceptz.com

MVC Components

MVC is divided into three main logical components namely model, view, and controller.

MODEL:

  • The model object knows about all the data that need to be displayed
  • It is model who is aware about all the operations that can be applied to transform that object
  • It only represents the data of an application
  • The model represents enterprise data and the business rules that govern access to and updates of this data

VIEW:

  • The view is responsible for the output of the model
  • A pure GUI view attaches to a model and renders its contents to the display surface
  • A web application view just transforms the state of the model into readable HTML

CONTROLLER:

  • In the MVC design pattern, application flow is mediated by a central controller
  • The controller delegates requests to an appropriate handler
  • The controller is the means by which the user interacts with the web application
  • If an invalid input is sent to the controller from the view, the model informs the controller to direct the view that error occurred and to tell it to try again.

Leave a Reply

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