Re: MVP with complex controls



In article <1151574865.353584.14140@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>,
"tailorma_de" <tailormade@xxxxxxx> wrote:

Hi NG,

I started to use the MVP pattern. I've read Martin Fowlers well-known
article. His provided example is understandable so far. However, I
don't understand how to deal with more sophisticated controls.

E.g. just a tree view is much more complex to control as a check box.
But that's something what I have already accomplished. What I have done
here is that I created a presenter and a view for nodes. With this I
can display and control a hierarchical structure in the model. So well,
this is done. I think such standard controls are manageable somehow.

But what is with more complex controls? And in particular what is with
reusable controls that resides in a library? How could I design such a
library so that it fits into the MVP concept? And what is with third
party libraries? How do I use them correctly?

As an example one could consider the Ablum Window of M. Fowlers article
as an own component which is supposed be included into an larger
application.

I could imagine if I have a third party component with an UI control
and that comes with a certain API. This API could offer some abstract
classes which have to be implemented in my app. Is it correct that in
this case the library must be referenced by the view and the presenter?
Hm, but this would make the view and the presenter very dependant on
each other. Is this okay?

What do you think?

I'd say it's OK. The presenter is customized for the View and Model
combination, if either of them changes, the Presenter will have to
change as well. The Presenter serves as a communication conduit between
the two.

The Presenter is not there to reduce the amount of change needed when
changing to a different View, it is there to facilitate testing. The
less code that is in the View objects, the less dependent you are on
having to eyeball every little bit of the app to ensure that it is
correct.

All IMHO of course.
.



Relevant Pages

  • MVP with complex controls
    ... I started to use the MVP pattern. ... I've read Martin Fowlers well-known ... I think such standard controls are manageable somehow. ... party libraries? ...
    (comp.object)
  • Re: Eine Frage zu Speicherfreigabe mit Dispose
    ... Presenter erstellt eine Instanz des Controls der View das er Verwalten soll. ... Nach meinem Kenntnissstand sollte jede Komponente die Dispose implementiert auch mit Dispose freigeben werden ... Meinung, das die Presenterklasse selbst die Dispose-Schnittstelle implementiert und wenn sie selbst durch Dispose freigegeben wird, die Dispose-Methode des Controls das es verwaltet aufruft. ...
    (microsoft.public.de.german.entwickler.dotnet.csharp)
  • Re: applying a VCX to an existing form
    ... Adding Class Libraries to the Controls Toolbar ... Designer as easily as Visual FoxPro base classes can be used. ...
    (microsoft.public.fox.vfp.forms)
  • Re: Any .Net controls youd recommend?
    ... >haven't found a plethora of great controls or class libraries (like I had ... I'm looking for controls that you ... Visual Basic 6 programmers were only the ... Express has the best site/service but ComponentOne has the grids I like ...
    (microsoft.public.dotnet.general)
  • Re: "Could not locate some objects...."
    ... >> laptop and then register it? ... > controls, you can find the library name as follows:- ... > you have on the desktop and make those libraries available on your laptop. ... > Then register them, if necessary. ...
    (microsoft.public.excel.programming)