MVC (Model View Controller)

Model fetching
  1. This is where the controller receives the request and asks the model for a request of all the sneakers. The model will then process the request and look for a list of all sneakers in the database.
  2. Now the controller receives the information given from the model, if successful the controller will now ask the view to return a presentation of sneakers.
  3. The view will take that information and render it in HTML. With everything being ready for the presentation the view will then send back the presentation back to the controller.
  4. Since the process went successfully, the controller will now return the user a list of sneakers as requested. Which will ultimately end the request.
  5. Let’s look back at number two. What if the request of data from the model was unsuccessful? Well this is when the controller has to take that information and go back to the view.
  6. View will then be asked by the controller to create an error presentation in the form of HTML to be ready to be sent to the user. Once completed the controller will tell the user the error that was made.

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store