[英]What role of adapter, service, content provider and other basic elements in MVP architecture of android app?
I figure out that it's very useful to use MVP pattern in my apps, but it's too complicated for me, how find out of role elements in apps, which is model, view, presenter? 我发现在我的应用程序中使用MVP模式非常有用,但是对我来说太复杂了,如何找出应用程序中的角色元素,即模型,视图,演示者?
There's no agreed definition on exactly the best way of MVP-ing in Android. 关于Android中MVP ing的最佳方式,尚无一致的定义。
My answers to your questions. 我对您问题的回答。
See this article on MVP 在MVP上查看此文章
Note : 注意事项 :
Try to ensure the Presenter does not have any Android logic or Android stuff. 尝试确保Presenter没有任何Android逻辑或Android内容。
Model doesn't just mean the POJO's it can mean include storing in DB, ContentProvider etc. including network retrieval. 模型不仅意味着POJO,还意味着包括存储在DB,ContentProvider等中,包括网络检索。
The View should not interact with the model directly ie data retrieval, storage etc. Only via the Presenter. 视图不应直接与模型进行交互,即数据检索,存储等。 只能通过演示者进行。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.