tags:

views:

149

answers:

2

I am still trying to get my brain wrapped around MVP. What should I use the controller class for? Is that where I access data resources?

+1  A: 

The Controller should act upon a Model, perhaps populating a model via a service layer call to a database. Usually with requests from the view the controller performs actions on the model.

The View is the presentation onscreen.

The Presenter handles flow between view and controller.

The reason for separating out presenters and controllers might be so that you can reuuse a certain controller with a different presenter etc.

Jafin
If controller is acting as a mediator between the presenter and the Model, then what are the responsibilities on the controller?
Anand Patel
A: 

In my opinion the presenter should not be coupled with the UI technology and should directly deal with the services layer of the model. There should just be a single controller in the application and that could be tightly coupled with the UI technology. Page navigation could be abstracted in the controller. I feel that, WCSF based MVP-Controller pattern is a slight variation of the original MVP pattern.

Let me suggest that presenter are to be implemented for reuse while controllers are not.

Anand Patel

related questions