Imagine a simple application with a list of customers:
CustomerWindow: ICustomerView
{
private CustomerPresenter customerPresenter;
CustomerWindow()
{
this.customerPresenter = new CustomerPresenter(this);
}
}
When the user clicks on a particular customer, the customer data editor window is displayed:
EditorWindow: IEditorView
{
private EditorPresenter editorPresenter;
EditorWindow()
{
this.editorPresenter= new EditorPresenter(this, ???);
}
}
EditorPresenter
must know the customer chosen by the user, but view doesn't know anything about the customer model and other model-layer parameters necessary for properly initialization of EditorPresenter
.
How can I solve this problem?