In this blog I am going to do my best to explain the MVC design pattern, this is part of my introduction into web development. MVC stands for model, view control and a design pattern is a reusable solution for commonly occurring scenarios, guidelines if you will. Something to keep in mind is this blog will be a general explanation of the MVC design pattern as it can be implemented in a variety of ways, some design patterns even borrow concepts from the MVC design pattern.
So let's start with the core responsibilities, of the model, view, and controller.
The Model of an application is usually responsible for data-related tasks, this could be something like a database. The model interacts with the view and controller a provides the data to be manipulated and rendered to the user. An example of this in action would be retrieving a customer's info from the database allowing the customer to view or manipulate it.
The controller is responsible for user input and processing get and post requests (more on that shortly). In short, the controller receives input from the user, gets data from the model and passes it to the view.
A quick explanation of get and post requests
Websites commonly work via The Hypertext Transfer Protocol (HTTP) or the Hypertext Transfer Protocol Secure (HHTPS)(sites with secure communication). When interacting with a website we use a combination of get and post requests, to send and receive information. The client (your browser) makes the get and post requests to a server (where a web app/site is hosted).
Here are a couple of videos I found on the subjects I covered, I will no doubt return to this subject in the near future, thanks very much for reading as always!