A Lesson by Donn Felker
In this Lesson you will learn:
- Build a Presenter (the “P” in MVP) based off a contract (interface)
- How to implement the interface in an implementation
- How to to rely on the UserView (the view) and UserRepository (repository pattern) abstractions (interfaces) instead of their concrete implementations
- How to have the presenter control all UI logic such as obtaining state, setting state, and UI messaging.
- How to inject the presenter interface through Dagger into the View (the fragment).
- How to wire up the presenter and the view together with the userPresenter#setView call.
- How the presenter takes over all orchestration during execution of the application with a live walkthrough of the running application code.
Links for this Lesson
Pro members: Log in to view the code for this Lesson!
Lessons in this course
- Model View Presenter – Part 1: The MVP Pattern Explained
- Model View Presenter – Part 2: Building the View
- Model View Presenter – Part 3: Wiring up the Presenter
- Model View Presenter – Part 4: Writing FAST jUnit JVM Tests with Mockito
- Model View Presenter – Part 5: Validating Code Coverage with jUnit 4, Mockito and Android Studio
- Model View Presenter – Part 6: Getting to 100% Code Coverage
- Model View Presenter: Part 7 – Removing Lifecycle Events from the Presenter
- Model View Presenter – Part 8: The ViewNotFoundException & Comprehensive Testing