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,業務邏輯放到這裏面

視圖:僅僅負責將模型展示出來

控制器:執行請求、對模型的操作並選擇視圖展示給用戶



發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章