MVC架构
2018-03-23 本文已影响0人
作者春霁
什么是MVC开发模式?
将程序分层,分别为Model层(负责数据管理,获取),View层(负责交互界面),Controller层(负责逻辑处理),移动端与服务器端不同,此处不多说。
架构原理图(别人画法)

架构原理图(我的画法)

说明
个人认为,以前并不会把Controller
单独建立类,直接将Fragment
与Activity
作为Controller
,所以从Model
回来,到底是到View上
还是Controller
上?
我以为,从Model
回来,最终是Controller
的逻辑结束过程,由此引发View
的改变则是Controller
通知View
变化。如果你把Controller
独立出来写,那就和MVP很接近了~~~