Using a MVP Pattern in a WinForms app I have been asked to write. Pardon VB.net as I am being forced to use this :(
Being New to MVP I have gone with a Passive Model implementation where there is no dependency between the View & the Model and only the Presenter knows both
The View being a representation of the UI what functionality should be part of the IVIEW interface
Should I have the methods/actions/tasks in the IView i.e
Property QItems As IList(Of QItem)
Property SelectedQItem As QItem
Property QueStatus As QueStatus
Property ReportName As String
Property ScheduleName As String
Sub BuildQItems()
Sub RunQue()
Sub StopQue()
Sub CancelCurrent()
Sub PauseCurrent()
and make the calls view the Iview Interface that is implemented in the winform
class Winform
implements IView
Private Sub btnCreate_Click(sender As System.Object, e As System.EventArgs) Handles btnCreate.Click Implements IVIEW.Create
If (_presenter.CreateSchdule()) Then
MessageBox.Show("Sucessfully Created")
Close()
End If
End Sub
End Class
or Should I just hold the state
Property QItems As IList(Of QItem)
Property SelectedQItem As QItem
Property QueStatus As QueStatus
Property ReportName As String
Property ScheduleName As String
And make the calls directly to the Presenter which is part of the WinForm and not bother about the Iview intreface
i.e
_presenter.BuildItems()
_presenter.RunQue()
How do you weigh up when to do either approach when using MVP ?