If “Each View has a Presenter in a one-to-one relationship”, why do you need interfaces like…
Lei Chen
1

Lei Chen

There are a number of benefits:

  1. It frees the implementation from the usage. You can at any time attach a new presenter to an activity that implements the same MvpPresenter without disturbing any other component at any phase of app development. It in effect decouples the Activity and Presenter.
  2. The presenter is a pura Java class and this abstraction free the Presenter to be tested in isolation at compile time.
  3. Only those apis are exposed to either classes that is required. Hence it prevents any accidental calling of non expected methods.
  4. The code readability is enhanced. We can just have a glance on the Mvp interfaces and deduce the purpose.
One clap, two clap, three clap, forty?

By clapping more or less, you can signal to us which stories really stand out.