I am about to start the development of a medium-sized CRUD RCP-based application and I intend to use the MVP (model view presenter) pattern.
I understand that the main difference between the MVP and the MVC is that the presenter updates the view whereas the controller doesn't.
What I really don't understand is who has a reference to what in this pattern. In one tutorial, I read that the view has a presenter instance variable (see: http://www.logicdevelopment.net/blog/?p=16). But the presenter also needs to have a reference to the view. Doesn't it? Is all of this correct?
Can anyone please provide explanations of how a typical MVP application is structured in terms of who owns references to what?
code added from the view:
button.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent event) {
// can we reference the presenter here? how?
}
});
Using information from link provided below I came up with the diagram below. Notice that the view has a reference to the presenter and vice versa (see option one from here):
