15.1. What is MVP?

As we wrote in the introduction, we should agree on what we’re talking about when we say MVP. It’s an approach to dividing code into layers that solves a number of issues with code, which can occur if you build an application on an ad hoc basis. Projects built in an ad hoc manner suffer from four intrinsic problems:

  • Adding new features will take an order of magnitude longer.
  • They’re impossible to optimize.
  • They’re extremely difficult to test.
  • Fixing and debugging can be a nightmare (fixing something in one place can lead to something else breaking that seems completely unrelated).

MVP aims to provide a “separation of concerns” of logic:

  • Model—Contains only data
  • View—Contains only UI code
  • Presenter—Drives and manages ...

Get GWT in Action, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.