Note that there are some explanatory texts on larger screens.

plurals
  1. POMVP Pattern What to include on the View Interface
    text
    copied!<p>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 :(</p> <p>Being New to MVP I have gone with a Passive Model implementation where there is no dependency between the View &amp; the Model and only the Presenter knows both </p> <p>The View being a representation of the UI what functionality should be part of the IVIEW interface </p> <p>Should I have the methods/actions/tasks in the IView i.e </p> <pre><code> 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() </code></pre> <p>and make the calls view the Iview Interface that is implemented in the winform </p> <pre><code>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 </code></pre> <p>or Should I just hold the state </p> <pre><code> Property QItems As IList(Of QItem) Property SelectedQItem As QItem Property QueStatus As QueStatus Property ReportName As String Property ScheduleName As String </code></pre> <p>And make the calls directly to the Presenter which is part of the WinForm and not bother about the Iview intreface </p> <p>i.e </p> <pre><code>_presenter.BuildItems() _presenter.RunQue() </code></pre> <p>How do you weigh up when to do either approach when using MVP ?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload