title: Nested MVP on Android: how to
body: <p>I am working on an Android test project composed of 3 main parts, each of which developed following the <strong>MVP pattern</strong>.
  These parts are <strong>nested</strong> into each other and I would like to know if the strategy I am following is the correct/best one or not</p>
  
  <p>Structure:</p>
  
  <ul>
  <li><strong>Book</strong>: ViewPager containing different Pages</li>
  <li><strong>Page</strong>: Custom LinearLayout containing multiple Items</li>
  <li><strong>Item</strong>: Custom View (in this example a simple button)</li>
  </ul>
  
  <p>Each part uses a MVP structure (so for example for Book I made BookPresenter, BookView and BookModel, and the same for Page and Item)</p>
  
  <p>As a <strong>user case</strong> I would like to keep track of how many times the user clicks the button and for each time change the Page background to a random color, and when the user reaches the 10th click tell the BookPresenter to go to the second page.</p>
  
  <p>To do so I set up things so</p>
  
  <ul>
  <li>BookView creates the BookPresenter, which in turns creates each PageView. </li>
  <li>Each PageView creates the PagePresenter which in turns creates the ItemView (which ultimately creates the ItemPresenter)</li>
  </ul>
  
  <p>In all this, the BookPresenter has a reference to the PagePresenter, and  the PagePresenter has a reference to the ItemPresenter, so when some actions need to take place they can communicate to the child or the parent presenter in the structure</p>
  
  <p><strong>Now the question:</strong>
  Is this the right way to set up a system with nested MVPs?
  Because if I then want to have a PageView but instead of in a Book I need to put it in a Newspaper (other class with some alternative behaviour to Book) I still would need to recreate the whole chain of dependencies with Presenters and all the rest...</p>