MVC(Model-View-Controller)与 MVP(Model-View-Presenter)有什么区别?
What is the difference between MVC (Model View Controller) and MVP (Model View Presenter)?
题目类型: 技术面试题
这是一道技术面试题,常见于澳洲IT公司面试中。
难度: hard
分类: system-design
标签: mvc, mvp, architecture, unit-testing
参考答案摘要
TL;DR MVC 用 Controller 连接 View 与 Model;MVP 用 Presenter 与 View 通过接口交互,并更利于单元测试。 MVC 模式建议将代码拆分为三层:Model、View、Controller。开发者创建类或文件时应归入其中一层。而 MVP 是架构模式的进一步演进,由 Model、View、Presenter 组成。 在 MVC 中,Controller ...
本题提供 STAR 原则详细解答和技术解析,登录匠人学院学习中心即可查看完整答案。