Honestly, I can't get around all these MVPs and similar things regarding Android: what is its essence?
So far, the only practical reason that I see the use of MVP in Android is to "extract" pieces of code that can be tested from wireframe classes (for example, "Activities", "Services", "Snippets"), which would otherwise be difficult (or impossible) to test.
This is good, but in this way actions (and other infrastructure classes) ultimately delegate work to the facilitator when possible (i.e., when working with the agnostic code of the framework) and work directly when not. Because of this, Hosts end up looking kinda weird, having methods that reflect the Activity lifecycles (onStart, onResume, clickListeners ...). I wonder if this is the smell of code?
In addition to this, I see a ton of libraries / templates for creating MVP applications for Android, but I honestly don’t see their real benefits: what is the disadvantage that each activity creates and manages its own host manually? I do not see any benefit in unleashing the Activity and the Presenter from each other, since the moderator is simply “extracting” some code from the Activity, it will be closely connected with it by definition, and it sounds great to me, as long as the moderator contains only strict presentation logic (the rest of the business logic goes into special classes that do not know anything about the View / Presenter duet).
I feel a little lost in this topic, and I would like other opinions on this issue to get a great perspective.
source share