From the course: JavaScript: Patterns
Model-View-Controller (MVC) pattern - JavaScript Tutorial
From the course: JavaScript: Patterns
Model-View-Controller (MVC) pattern
- If you've been programming for a few years, you may or may not have heard of the Model-View-Controller pattern. But it is often the first thing you learn as you grow more experience as a developer. This pattern basically defines how an application should be split, and often reflects how your modules are organized within three simple categories, models, views, and controllers. The model is where your data resides, where you define your schemas and the models for your data. The views is where you have your views, or in most cases, the pure HTML of you application, where the visuals are. And finally, the controllers are where you have your logic of your application, the functions that makes your application run. Following this pattern, most developers split all the files and structure of their application following this pattern. And even sometimes name the folders with these labels. Nowadays, this approach to splitting your application has evolved especially with applications like React. Which is more MVVM? I will explore this shortly, but it remains the basis of how most frameworks and applications are structured. Having a good understanding of what this pattern is will go a long way to understand how most applications are organized.
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
(Locked)
What are structural patterns?55s
-
(Locked)
Module pattern5m 54s
-
(Locked)
Mixins pattern4m 32s
-
(Locked)
Facade pattern1m 43s
-
(Locked)
Flyweight pattern1m 18s
-
(Locked)
Decorator pattern2m 16s
-
Model-View-Controller (MVC) pattern1m 21s
-
Model-View-Presenter (MVP) pattern1m 17s
-
(Locked)
Model-View-ViewModel (MVVM) pattern1m 25s
-
(Locked)
-
-