Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>What I've done in the past is use something similar, <a href="http://download.microsoft.com/download/3/a/7/3a7fa450-1f33-41f7-9e6d-3aa95b5a6aea/MSDNMagazineAugust2006en-us.chm" rel="nofollow noreferrer">Model-View-Presenter</a>.</p> <p>[NOTE: This article used to be available on the web. To see it now, you'll need to download the CHM, and then view the file properties and click Unblock. Then you can open the CHM and find the article. Thanks a million, Microsoft! <em>sigh</em>]</p> <p>The form is the view, and I have an IView interface for it. All the processing happens in the presenter, which is just a class. The form creates a new presenter, and passes itself as the presenter's IView. This way for testing you can pass in a fake IView instead, and then send commands to it from the presenter and detect the results.</p> <p>If I were to use a full-fledged Model-View-Controller, I guess I'd do it this way:</p> <ul> <li>The form is the <strong>view</strong>. It sends commands to the model, raises events which the controller can subscribe to, and subscribes to events from the model.</li> <li>The <strong>controller</strong> is a class that subscribes to the view's events and sends commands to the view and to the model.</li> <li>The <strong>model</strong> raises events that the view subscribes to.</li> </ul> <p>This would fit with <a href="http://en.wikipedia.org/wiki/Model-view-controller" rel="nofollow noreferrer">the classic MVC diagram</a>. The biggest disadvantage is that with events, it can be hard to tell who's subscribing to what. The MVP pattern uses methods instead of events (at least the way I've implemented it). When the form/view raises an event (e.g. someButton.Click), the form simply calls a method on the presenter to run the logic for it. The view and model don't have any direct connection at all; they both have to go through the presenter.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

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