1 00:00:00,000 --> 00:00:09,181 [MUSIC] 2 00:00:09,181 --> 00:00:12,710 HI, I'm Jonathan, a teacher here at Treehouse. 3 00:00:12,710 --> 00:00:16,700 In this workshop I'll introduce you to a common pattern used in many different 4 00:00:16,700 --> 00:00:19,490 programming languages and programming frameworks. 5 00:00:20,500 --> 00:00:26,905 Very popular tools like Laravel for PHP, Ruby on Rails, Pythons Django framework, 6 00:00:26,905 --> 00:00:31,910 ASP.NET, iOS, Express in JavaScript and 7 00:00:31,910 --> 00:00:37,380 Spring for Java all use the MVC pattern or some close variant. 8 00:00:37,380 --> 00:00:39,200 But what exactly is MVC?. 9 00:00:40,430 --> 00:00:45,660 MVC is an acronym that stands for Model View Controller. 10 00:00:45,660 --> 00:00:48,560 It isn't a language or specific technology, 11 00:00:48,560 --> 00:00:52,740 it's a way of thinking about and structuring a computer program. 12 00:00:52,740 --> 00:00:55,200 We call it a programming pattern. 13 00:00:55,200 --> 00:00:59,050 A programming pattern is a way of organizing a programs logic to handle 14 00:00:59,050 --> 00:01:01,600 common tasks or solve problems. 15 00:01:01,600 --> 00:01:04,310 Most web applications perform similar tasks. 16 00:01:05,860 --> 00:01:08,910 A visitor requests a page from a website, for 17 00:01:08,910 --> 00:01:14,340 example, requesting information about the movie Toy Story from IMDb. 18 00:01:14,340 --> 00:01:18,076 The website collects the information from a database, 19 00:01:18,076 --> 00:01:23,334 all the facts about Toy Story when it was released, who stars in it, and so on. 20 00:01:23,334 --> 00:01:27,279 The site organize that information into a presentation, 21 00:01:27,279 --> 00:01:31,947 the layout of the webpage with specific data and photos and finally, 22 00:01:31,947 --> 00:01:36,637 sends that web page back to the visitor who views it in their browser. 23 00:01:36,637 --> 00:01:43,075 That same pattern is true whether you're IMDB, Amazon, Facebook or Google. 24 00:01:43,075 --> 00:01:45,292 Each site does different things, but 25 00:01:45,292 --> 00:01:49,000 those basic tasks are common between all of them. 26 00:01:49,000 --> 00:01:52,900 The MVC pattern provides a way of organizing common tasks 27 00:01:52,900 --> 00:01:55,550 into very clear responsibilities. 28 00:01:55,550 --> 00:02:00,260 The C or controller handles all communication between the user and 29 00:02:00,260 --> 00:02:02,440 other parts of the application. 30 00:02:02,440 --> 00:02:06,060 The M, or model, handles and retrieves data. 31 00:02:06,060 --> 00:02:10,270 While the V, or view, organizes that data into a visual presentation. 32 00:02:11,910 --> 00:02:16,150 While this may sound like unnecessary organization, in the next video 33 00:02:16,150 --> 00:02:20,910 I'll explain why you'd want to use the MVC pattern to build your applications.