在MVP中,谁应该处理导航? [英] In MVP, who should handle navigation?

查看:132
本文介绍了在MVP中,谁应该处理导航?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我相信Presenter是负责处理MVP应用程序导航方面的人.这是真的还是有例外?

It's my belief that the Presenter is the one responsible for handling the navigation aspect of a MVP application. Is this true or are there exceptions?

推荐答案

您是对的.模型无法做到,视图也无法做到.

You are right. The model cannot do it, and the view cannot do it.

在我的应用中,导航是通过从最大的演示者到较小的演示者的级联来处理的.例如,整个应用程序演示者会获取整个位置,然后对其进行解析,并将所有相关内容发送给下一个演示者以获取更详细的细节.

In my apps, navigation is handled by cascading from the largest presenters to the smaller ones. For instance the overall app presenter gets the whole location, parses it, and sends any relevant pieces to the next presenter for finer-grained detail.

这篇关于在MVP中,谁应该处理导航?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆