What rules do you use to define MVP methods and members
I prefer the passive MVP view option, so this is not a problem for me. In a passive View template, quite a few delegates do something more complex than simply assigning to a presenter.
You end up with a template that looks like this:
public class MyView: IView
{
private MyPresenter Presenter;
private OnEvent()
{
Presenter.DoSomething();
}
public string MyProperty
{
get{ return UIControl.Property;}
set{ UIControl.Property = value}
}
}
public interface IView
{
public string MyProperty{ get; set;}
}
public class MyPresenter
{
private IView view;
public void DoSomething()
{
...
view.MyProperty = something;
}
}
The only tricky part is if you have a datagrid in your form. They take a lot of work to fit into the passive look.
a source to share
It boils down to how much manipulation of the user interface is. If the method consists of a lot of direct access to individual controls, then it probably belongs to the master. Otherwise, it belongs to the species. The goal is to reduce the interaction between the view and the present to the minimum necessary to complete the software design.
for instance
Presenter.SetListTitle MyList.Name
For I = View.MyListStart to View.MyListEnd
Presenter.AddListItem MyList(I)
Next I
Presenter.ShowListAddBUtton
Presenter.ShowListDelButton
Should be placed in the presenter below
Public Sub UpdateWithList(MyList as AList, View as AView)
Me.SetListTitle MyList.Name
For I = View.MyListStart to View.MyListEnd
Me.AddListItem MyList(I)
Next I
Me.ShowListAddBUtton
Me.ShowListDelButton
End Sub
Later, if you decide to change your UI, all you need to worry about is injecting UpdateWithList, not SetListTitle, AddListItem, etc. etc.
a source to share