Understanding MVC Architecture
00:00 What is Model-View-Controller architecture? A website is made of several different components which come together to store data, format it, and redirect it.
00:09 In this lesson, you’ll learn how to define the components that make up Model-View-Controller architecture. The core of a website is the data it is presenting, whether that is videos, blog posts, stats, or more.
00:23 Usually, the data is stored in a database, and the way you interact with and organize that data is referred to as the model. A model is a representation of data in your application.
00:34 Instead of just dumping a bunch of data on the user, it’s best to format it somehow. This is done in the view, and this view controls what the user sees. A view is how your data is presented to the user.
00:48 To connect everything together, you’ll need a central system which connects the model and the view together. This part is known as the controller. A controller is a central hub which passes data from the model to the view.
01:02 Here is a diagram to demonstrate how these components fit together to form the Model-View-Controller pattern. The journey starts at the user’s request for a website, which reaches a controller.
01:14 The controller fetches the necessary data from the model, which is then passed off to the view. Finally, the view returns a web page, which is the response the user finally sees.
01:25 Now you know how the MVC pattern works, you probably want to put it together yourself. In the next lesson, you’ll use Flask to do just that.
Become a Member to join the conversation.