The Model-View-Controller pattern

Let's start the discussion about the MVC pattern with a diagram:

The diagram shows the flow of a request in an Application using the MVC pattern. When a user makes a new Request, the Request is intercepted by the Application, which then forwards the Request to the appropriate Controller for that Request. Once the Request is received by the Controller, it then interacts with the model, which performs some business logic based on the Request received by it. This could involve the updating of databases, or fetching some data. Once the business logic is executed by the Model, the Controller executes the View with any data that needs to be passed to the View, which then displays the Response for the Request.

Although we will be implementing the MVC pattern later in the book, when we develop our BugZot application, let's take a look at the different components in the MVC pattern, and what roles they play.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.22.77.63