1 、MVC 分层职责和处理流程

Models, which contain or represent the data that users work with. These can be simple view models, which just represent data being transferred between views and controllers; or they can be domain models, which contain the data in a business domain as well as the operations, transformations, and rules for

manipulating that data.


Views, which are used to render some part of the model as a UI.


Controllers, which process incoming requests, perform operations on the model,and select views to render to the user.



模型:包含用户要处理的数据,分为view models和domain models,业务逻辑放到这里面

视图:仅仅负责将模型展示出来

控制器:执行请求、对模型的操作并选择视图展示给用户



猜你喜欢

转载自blog.csdn.net/xiongxyt2/article/details/8038757
今日推荐