-, . -, . - .
:
public class SomePresenter
{
public ShowContactView(IContactView view)
{
IContact model = new Contact();
new ContactPresenter(model, view);
view.Show();
}
}
public class AnotherPresenter
{
public ShowContactView(IContactView view)
{
IContact model = new Contact();
new ContactPresenter(model, view);
view.Show();
}
}
public class YetAnotherPresenter
{
public ShowContactView(IContactView view)
{
IContact model = new Contact();
new ContactPresenter(model, view);
view.Show();
}
}
public partial class ContactView : Form, IContactView
{
public ContactView()
{
InitializeComponent();
}
}
:
public class SomePresenter
{
public ShowContactView(IContactView view)
{
view.Show();
}
}
public class AnotherPresenter
{
public ShowContactView(IContactView view)
{
view.Show();
}
}
public class YetAnotherPresenter
{
public ShowContactView(IContactView view)
{
view.Show();
}
}
public partial class ContactView : Form, IContactView
{
public ContactView()
{
InitializeComponent();
new ContactPresenter(new Contact(), this);
}
}
, . , , , , , .. , , .
, " " , Presenter View, Presenter . View Presenter..
But more importantly, to see how different models fit your business. To be honest, there are even more options. See this duplicate question.
source
share