Model-View-Controller
Updated 2026-07-28
Summary
The Model-View-Controller (MVC) pattern is a software architecture pattern in software engineering that divides a software system into three basic parts: Model, View, and Controller. The MVC pattern was first proposed by Trygve Reenskaug in 1978 and was invented at Xerox PARC in the 1980s for the programming language Smalltalk.
Definition
The Model-View-Controller (MVC) pattern is a software architecture pattern in software engineering that divides a software system into three basic parts: Model, View, and Controller. The MVC pattern was first proposed by Trygve Reenskaug in 1978 and was invented at Xerox PARC in the 1980s for the programming language Smalltalk. The purpose of the MVC pattern is to achieve dynamic programming, simplify subsequent modifications and extensions, and enable reuse of parts of the program. Additionally, this pattern makes the program structure more intuitive by simplifying complexity. By separating the basic parts of the software system, it also assigns appropriate functions to each part. Professionals can group based on their expertise: Model - programmers write the functions (implement algorithms, etc.), database experts handle data management and database design (can implement specific functions).
Introduction
How to use
The Model-View-Controller (MVC) pattern is a software architecture pattern in software engineering that divides a software system into three basic parts: Model, View, and Controller. The MVC pattern was first proposed by Trygve Reenskaug in 1978 and was invented at Xerox PARC in the 1980s for the programming language Smalltalk.
Mechanism
Reduce complexity through separation of concerns: The Model holds data and business rules, the View is responsible for presentation, and the Controller receives input and coordinates the other two. After decoupling, modifying the interface does not affect the logic, and modifying the logic does not require rewriting the interface; each can evolve and be tested independently.
Practice
In progress 0/4Practice this model in one real situation:
Cases
- In web applications, the database and calculation logic are in the Model, HTML pages are in the View, and routing and form handling are in the Controller; redesigning the page does not affect business rules. Similarly, when making a PPT: Model = core data and conclusions, View = layout and beautification, Controller = presentation logic.
Common pitfalls
- Writing business logic into the View (e.g., calculating directly in the page); the Controller becoming too bloated into a "god class"; ignoring unidirectional data flow leading to difficult state tracking.
Sources
Source support: Explicit
References currently contain only Wikipedia links; primary sources still need review.
- zh.wikipedia.orghttps://zh.wikipedia.org/wiki/MVCverified
account_treeGenealogyexpand_more
PRIVATE NOTES · Only visible to you
SAVED Q&A
ENTRY Q&A · Private saving available
Ask with a clear boundary
thinkingmodels answers from published entry context only.
Your question is sent to thinkingmodels. The answer uses public entry context only.
RELATED MODELS