3

What is the reason Google says MVP is recommended for building GWT apps? I really like MVC approach when View layer is directly aware of what the Model is - why do they think that's bad idea?

Andrey Agibalov
  • 7,624
  • 8
  • 66
  • 111

2 Answers2

10

As Google explains: “this model allows us to minimize our use of GWTTestCase, which relies on the presence of a browser, and, for the bulk of our code, write lightweight (and fast) JRE tests (which don't require a browser)”.

Also: What is the advantage of the MVP pattern (GWT)

MVC or MVP? Which design pattern makes the most sense?

Community
  • 1
  • 1
Artem Koshelev
  • 10,548
  • 4
  • 36
  • 68
2

Well, the issue is: MVC is a nice way to structure you application, but it does have negative impact on testing. MVP is nothing new, it is also known as Lazy View Pattern and it leverages the mocking of a view for testing or even for different views on different plattforms.

Newer MVC approaches/ framework did push a lot of functionality into the view markup (renderers, validation frameworks, binding frameworks) which in fact lead to fewer functionality on the controller, less testability and duplicate code (ok, duplicate "intelligent" markup).

Everyone who did a bit more JSF than a HelloWorld and started duplicating markup knows what I am talking about.