Home > Mobile >  MVP way to write some problems in the Android
MVP way to write some problems in the Android

Time:02-07

Model layer, it took me only one interface, because the request is according to the entity class (to regulate method, is to add and delete, the class name I haven't change) in the interface with the generics, presenter using an interface reference Model

Presenter layers, with each presenter is an interface, and one-to-one correspondence with the view layer (to establish the link of the interface with a view to prevent memory leaks)

The view layer, and each view corresponding to an interface,

Question:
1. So writing is the MVP?
Method of layer 2. The presenter, because each presenter is different (there may be a similar), so each corresponds to an interface, but as a result, the use of the interface seems only specification method, there is no other use (in this case is that presenter did not need to set the interface layer, view layer direct references to the class to go)?
3. The interface for the view layer and presenter link to prevent memory leaks (whether interface writing can not only ACTS as a link, otherwise also plays a role of standard method and the interface in a presenter only)?

CodePudding user response:

Look at another, this figure
  • Related