OK, dear reader(s), I haven't had much luck engaging you in the past but let's see how I fare in 2007.
I'm implementing my very first Model-View-Presenter. She's a bonny WinForms application that, at its core, takes an Excel spreadsheet and converts it into another format. It uses a plug-in architecture so that you (as in I) can create other "converters" and drop them into the plug-in directory without having to recompile.
That has nothing to do with my question but I've typed it and I don't want to delete it.
I've seen many, many, many, many examples of Model-View-Presenter, most of them very clear and easy to follow but all suffering from a problem I am just now encountering: My form does more than display a list of employees.
So my question is, how do you implement a page that, for example, displays two lists, then allows the user to select one item from each and click a button that will do something with the two selections?
- Do you encapsulate each list in a user control, each implementing their own view and presenter?
- Do you create a view/presenter for each section and have the main form implement each view and create each presenter?
- Do you treat the whole form as one view with one presenter?
- Do you use multiple views (one for each "section") with one presenter to control them all?
- Do you use one view but register it with multiple presenters? (I threw that in for completeness; it sounds kind of wacky to me.)
The first person that responds with "It depends" will be shot on sight.