MVP Pattern guidance from patterns & practices

time to read 2 min | 275 words

 In have tried to find a clever way of saying this, but I couldn't really find a good one. Saying that I am happy about it should suffice.

The P&P's guidance package for MVP goes over the pattern, forces, limitations and reasoning behind the pattern.

The MVP quick starts comes with a CWAB and POCO versions, and it is interesting to compare the two. Frankly, I consider the manual hooking of the presenter in the view to be an anti pattern. It is a PITA of the first order, to start with, and it mixes concerns. 

There aren't really good options to avoid that unless you have a container in place, however. So the conclusion is that you want to use a container :-) The example with CWAB is much close to the way I would do. There are semantic differences, but not anything major (conventions vs. [Marker], mostly). The tests show examples of hand rolled mocks, it serves as a good example to remind you why you need a mocking framework.

I think that this is a really good introduction to MVP, and it opens the door to open a lot of the problems that drives the adoption of further tools and approaches.

I found it interesting that they introduced another level of abstraction, they have a controller, which serves to link to presenters together, if they need to work in concrete on the UI. I don't think that I have seen this approach before, and it took me a few minutes to realize that the controller is actually hooking two different presenters.

To the P&P team, that is very nicely done.