想象一个带有客户列表的简单应用程序:
CustomerWindow: ICustomerView
{
private CustomerPresenter customerPresenter;
CustomerWindow()
{
this.customerPresenter = new CustomerPresenter(this);
}
}
当用户单击特定客户时,将显示客户数据编辑器窗口:
EditorWindow: IEditorView
{
private EditorPresenter editorPresenter;
EditorWindow()
{
this.editorPresenter= new EditorPresenter(this, ???);
}
}
EditorPresenter
必须知道用户选择的客户,但视图不知道客户模型和正确初始化EditorPresenter
.
我怎么解决这个问题?