Tam H. Doan
1 min readOct 27, 2019

--

IMO, the Contract interface is optional.

Google propose it in the Android Architecture repository to describes the communication between view and presenter, it helps you to design in a cleaner way the interaction. But it never be “must have”.

The View contract is helpful, the presenter will depend on the View interface and not directly on the Activity, help decouple the presenter from the view implementation (and from Android platform to support unit testing).

But do we really need a Presenter interface? You will likely never write an alternative Presenter, then it would be a waste of time.

--

--

Tam H. Doan
Tam H. Doan

Written by Tam H. Doan

Software Engineer, also a Writer and Runner

Responses (2)