android - MVP模式 包的结构
黄舟
黄舟 2017-04-17 17:31:53
0
2
583

就包的结构
我看到过两种

结构一


结构二

model view presenter是按模块分类比较好,还是写在一起比较好?
还有,是不是小项目用了mvp反而显得麻烦?
谢谢!

黄舟
黄舟

人生最曼妙的风景,竟是内心的淡定与从容!

reply all (2)
迷茫

First of all, I always think thatMVPwill become dirty if the business is complicated.
For example: Your business needs to do something before initiating a request, something needs to be done after the request responds, and finally something needs to be done for error handling. Then a business needs to write 4 interfaces.MVP业务复杂的话会变得很脏。
比如: 你一个业务发起请求前需要做一些事,请求响应后需要做一些事,最后错误处理还要做一些事,那么一个业务需要写4个接口。

其次,Presenter

Secondly, Presenteris business-related, not page-related.

Finally, it is a design pattern idea. There is no need to be strict about the package structure, just do whatever you like.
    PHPzhong

    Personal understanding:
    1. Divide by business module
    2. Within the business module, divide MVP
    3. Of course, you need base, common, etc. dependencies

      Latest Downloads
      More>
      Web Effects
      Website Source Code
      Website Materials
      Front End Template
      About us Disclaimer Sitemap
      php.cn:Public welfare online PHP training,Help PHP learners grow quickly!