Why use MVC?1:45 with Jonathan Barrios
Learn how the MVC pattern helps create more modular, reusable and testable code.
The MVC model may sound like a lot of work, but 0:00 it provides many, many benefits for developers. 0:03 Most importantly, 0:08 MVC separates a program into individual parts that handle specific tasks. 0:09 The model only handles data. 0:15 The view only handles the presentation of data, and the controller handles 0:17 all of the communication between the model, view, and user. 0:21 This one principal task is sometimes called the separation of concerns, 0:26 meaning each part of the program has just a single task or concern. 0:31 This pattern let's team of developers work on different parts of a program 0:36 at the same time leading to faster development. 0:40 MVC also makes it easier to find errors if one part isn't 0:44 returning what you're expecting, then it's much easier to fix because you only 0:48 need to look into one specific part or concern to locate the error. 0:53 MVC helps you create flexible and reusable components. 0:59 For example, if the model only contains specific data, 1:03 you can use the same model with different views using the same information. 1:07 That is to say, a database like IMDB can use the same data for 1:12 a movie but presented on different pages such as the trailer page, 1:16 a ratings page or on the homepage. 1:21 Overall, MVC provides a pattern for you to program in a very structured and 1:25 efficient way that helps you work faster and create better software. 1:30 Let's dig deeper into the MVC pattern. 1:35 In the next video, I'll introduce you to the master mind behind the pattern. 1:37 The C in MVC, known as the controller. 1:41 See you there. 1:44
You need to sign up for Treehouse in order to download course files.Sign up