Bummer! This is just a preview. You need to be signed in with a Basic account to view the entire video.
MVC Design Pattern2:49 with Alena Holligan
Written descriptions for common programming solutions are referred to as what? Developers have noticed patterns of repeated problems that show up in many application across every language. By describing solutions in general terms, developers are able to share common solutions to these problems. These solutions are called Design Patterns. One of the most common design patterns is the Model-View-Controller or MVC pattern. The "Model" represents the data in your application, the "View" is the visual component or interface, and the "Controller" is responsible for coordinating the specific actions needed, in order to return a response for a user request.
Model-View-Controller is an architectural design pattern commonly used for developing applications. The MVC design pattern decouples these major components allowing for efficient code reuse and parallel development. This pattern can be found in many popular programming language. Java, C#, Ruby, PHP have MVC frameworks that are used in web application development straight out of the box.
The model represents the data in your application
The view is the visual component that presents the interface for users to interact with that data, such as clickable links, form fields, and buttons.,
The controller is the coordinator. When users browse to a specific page in our website, the controller is responsible for coordinating what specific actions need to be performed, in order to return a response for that user request.
Over the decades that developers have been creating software, 0:00 they noticed a set of problems that kept coming up time and time again. 0:04 Some of these problems were so common that developers realized it would be helpful 0:09 to describe their solutions in very general terms, and share them with others. 0:14 That way, developers anywhere, regardless of which specific language they're using, 0:19 could learn and benefit from their efforts. 0:24 These solutions, often represented as written descriptions or 0:27 templates, are referred to as design patterns. 0:31 One of the most common design patterns is the MVC pattern, 0:36 which refers to the overall structure of an application itself. 0:40 When visual content is mixed in with data and stitched together in multiple places, 0:44 fixing bugs and adding features becomes a nightmare. 0:50 This is often referred to as spaghetti code, because it's a jumbled 0:54 mess that you have to untangle before you can do anything productive. 0:58 We've seen a very small example of organizing code by separating out 1:03 the header and footer files into their own individual documents. 1:08 This allows us to make changes to our navigation in one place 1:12 without having to go into each page individually. 1:16 At the heart of the MVC pattern is what is known as the separation of concerns. 1:19 This separation works much the same way as 1:25 individual stations in a factory production line. 1:28 Each station performs its specific job. 1:32 Separating our application into logical components allows 1:36 each component to perform very specific and limited tasks. 1:40 MVC is an acronym that stands for Model-View-Controller. 1:45 The model represents the data in your application. 1:50 The view is the visual component that presents the interface for 1:54 users to interact with that data, such as clickable links, form fields, and buttons. 1:59 The controller is the coordinator. 2:05 When users browse to a specific page in our website, 2:08 the controller is responsible for coordinating what specific actions need 2:12 to be preformed in order to return a response for that user's request. 2:17 All of this can seem overly complicated, especially when you're new to development. 2:21 It's okay to feel that way. 2:26 As developers, it's important and helpful to know the big picture, but 2:28 it's not something that we think about all the time. 2:33 As we build our website, we'll be focusing on small, 2:36 individual components of the process. 2:39 This will allow our brain to focus on individual tasks 2:42 without having to understand everything completely. 2:46
You need to sign up for Treehouse in order to download course files.Sign up