1 00:00:00,394 --> 00:00:06,145 The M in MVC stands for model and represents an application's knowledge, 2 00:00:06,145 --> 00:00:10,539 in other words, what the application knows or its data. 3 00:00:10,539 --> 00:00:13,934 Models represent data and interact with the database. 4 00:00:13,934 --> 00:00:19,999 Creating, reading, updating, and deleting data, or CRUD for short. 5 00:00:19,999 --> 00:00:24,455 For example, say a user visits a movie page on IMDb, 6 00:00:24,455 --> 00:00:27,611 the URL is handed to the controller. 7 00:00:27,611 --> 00:00:31,771 Remember, controllers handle all of the communication in the app. 8 00:00:31,771 --> 00:00:36,530 The controller knows it needs some data so it talks to a particular model for 9 00:00:36,530 --> 00:00:37,898 movie information. 10 00:00:37,898 --> 00:00:41,100 The controller doesn't know how the model does what it does. 11 00:00:41,100 --> 00:00:45,261 It just says, hey model, I need information about Toy Story. 12 00:00:45,261 --> 00:00:49,115 And the model doesn't know anything about how that information will be used. 13 00:00:49,115 --> 00:00:52,776 For example, what the final web pages will look like. 14 00:00:52,776 --> 00:00:56,092 The model doesn't know anything beyond its single function. 15 00:00:56,092 --> 00:01:00,086 An application will have different models for different pieces of data. 16 00:01:00,086 --> 00:01:05,174 For example, a user model with data related to users on a site, 17 00:01:05,174 --> 00:01:10,653 a movie model for a movie, an actor model for actor data, and so on. 18 00:01:10,653 --> 00:01:15,188 After receiving the request the model returns the data to the controller. 19 00:01:15,188 --> 00:01:20,358 In the IMDb example the model hands the Toy Story data to the controller. 20 00:01:20,358 --> 00:01:24,020 And the controller, as you'll see next, hands the data to the view.