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.
随堂练习,边学边练
下载课堂讲义。学练结合,紧跟进度,轻松巩固知识。
内容
-
-
-
-
-
(已锁定)
What are structural patterns?55 秒
-
(已锁定)
Module pattern5 分钟 54 秒
-
(已锁定)
Mixins pattern4 分钟 32 秒
-
(已锁定)
Facade pattern1 分钟 43 秒
-
(已锁定)
Flyweight pattern1 分钟 18 秒
-
(已锁定)
Decorator pattern2 分钟 16 秒
-
Model-View-Controller (MVC) pattern1 分钟 21 秒
-
Model-View-Presenter (MVP) pattern1 分钟 17 秒
-
(已锁定)
Model-View-ViewModel (MVVM) pattern1 分钟 25 秒
-
(已锁定)
-
-