MVC模式

Each piece of the MVC architecture is well defined and self-contained, which is referred to as the
separation of concerns. The logic that manipulates the data in the model is contained only in the model,
the logic that displays data is only in the view, and the code that handles user requests and input is
contained only in the controller. With a clear division between each of the pieces, your application will
be easier to maintain and extend over its lifetime, no matter how large it becomes.

简单来说,就是MVC的每一层都是定义明确而且是自包含,业务逻辑数据应当而且只能在Model层,显示逻辑应当而且只能在View层,处理用户请求和输入的应当而且只能在Controller层。

自己之前总是混淆了Model层和Controller层,把Model层当成了单纯的数据类,而把处理业务逻辑都放到了Controller层,现在总算是明白了

http://www.kissit.com.cn/
原文地址:https://www.cnblogs.com/Junelee1211/p/2507196.html