mvp+rxjava2.0+retrofit2.0+realm

1.mvp包分类:

Contact:(1)view接口(2)presenter接口    ----作为接口统筹调用,以供v层和p层的互相调用。也方便开发者理清逻辑

Activity:继承view接口持有presenter 的接口--持有接口不持有presenter实例,以保证层与层调用皆以接口调用。

----对应v层


presernter:继承presenter接口--网络或数据库耗时操作时使用rxjava2.0启动异步

 ----对应P层

model: (1)DBhelper--Realm(2)API--retrofit2.0

数据库耗时操作和网络请求都在p层调用。 

 ----对应M层

2.具体代码:

猜你喜欢

转载自blog.csdn.net/qq_16639803/article/details/81669373