Model-View-Presenter: Why is the model static?

I am trying to fully understand the model view presentation template, as applicable to C #. I have one question that I can’t cover my head with.

In many examples, I noticed that the model is defined as static and built in the base class Presenter (often this is a general class).

How do you have several model classes in this case? In my opinion, each created presenter can only refer to one model class.

The example I'm currently looking at can be found here: http://wesaday.files.wordpress.com/2009/01/finalzip.doc (rename to .zip). This is from this lesson: http://wesaday.wordpress.com/2009/01/30/winform-model-view-presenter-part-v-the-view/

Guess what the general problem I am having is how the examples like the ones above adapt to a working application with multiple views / presenters / models.

+8
c # wpf
source share
1 answer

This is apparently just a simplification to avoid including the full implementation of IoC in the sample. The MVP triad is typically represented by stand-alone (i.e., non-static, single-point, or otherwise shared) instances at runtime. In some exceptional cases, the model may be a generic instance, but usually it is an exception, not a rule, and usually it applies only to forms or read-only elements.

+4
source share

All Articles