I am a big proponent of MVP and have not really tried MVVM. The lack of the ability to get out of hand Presenter
is something I have had experience with, but it can be mitigated.
In the post example, the business logic will be relatively simple. There is probably only one model to solve and not too complicated logic.
Think of a more complex example. Say you have an app that sells flowers. Once the user has selected his bunch of flowers, they get to the order parameters screen, where they can:
- add message to flowers
- choose a gift vase
- select postal addresses
- select delivery date
Then add some domain requirements:
- you cannot add a message if it delivers abroad
UX, - , Presenter
, Model
(, , , ) View
, Model
. . , 500 , .
. UseCase
. :
public abstract class UseCase<I, O> {
public static final int NO_STATUS = -1;
public Observable<Integer> getStatus() {
return Observable.just(NO_STATUS);
}
public abstract Observable<O> getAction(I input);
}
, , . Presenter
View
UseCase
, Model
Presenter View
.
Presenter
, , .
, Presenter
, View
Model
, - .