[Tutor] MVC/MVP examples of how to implement it

Alan Gauld alan.gauld at btinternet.com
Tue Dec 19 11:39:12 CET 2006


"Don Taylor" <nospamformeSVP at gmail.com> wrote in
>>
> This is the best description - by far - that I have seen for the MVC
> pattern.
>
> http://groups.google.ca/group/comp.lang.python/msg/f8990a2c666a793c?hl=en&
>

You are right, that's a very good description, especially given it's
all text and no diagrams to help!

However it is a slightly blinkered picture of MVC and not totally 
accurate
in that some MVC implementations do allow the model to talk to
controllers/views. eg. The original Smalltalk MVC had a concept of
pluggable controllers whereby the controller had to fit a standard
protocol and models therefore knew what messages to send.
And thus multiple controllers could be connected to a single view
or model, as well as multiple views per model. Others broadcast
changes to a list of associated views, again via a standard protocol.

More modern implementations tend to use the publish./subscribe
notification technique referred to in the last few paragraphs of the
article. But MVC is not a single solution and any description will
be flawed with regard to some implementation or other. So long
as you are aware that differences exist (and are not "wrong" just
because they are different) then the article is excellent.

Alan G 




More information about the Tutor mailing list