Using MVC when the model is dynamic

Cameron Laird claird at lairds.com
Thu Oct 2 07:57:06 EDT 2003


In article <YkPeb.10891$RW4.8963 at newsread4.news.pas.earthlink.net>,
Mitch Chapman  <mitchchapman at earthlink.net> wrote:
			.
			.
			.
>I'm confused by the comments about the model needing to poll for new
>instructions from the view.  (BTW does this mean you usually prefer to
>combine view and controller responsibilities in a single entity, rather
>than implement them separately?)
This *is* an apt question.  Is there something
about wxWindows that pushes one in this direc-
tion, or was it just an abbreviation of the
evident fact that both the View and Controller
connect to the same end-user?
>
>Why not just have the model provide control methods which clients can
>invoke directly (t. ex. the stop() method in the example I posted)?
>Are you saying this doesn't fit well in wxPython, that it's more
>natural in that environment to communicate via event codes and queues?
>
>If that's the case, can you define a model-controller class which
>receives view events and translates them into method invocations on
>an associated model?  That does seem like a lot of work, but it
>would let the model remain ignorant of -- loosely coupled to --
>its observers.
My experience in this area is that this sort
of reliance on synthetic events is *not* "a
lot of work".  I've found it quite rewarding.
You're right:  it healthily decouples M from
V from C.
			.
			.
			.
-- 

Cameron Laird <Cameron at Lairds.com>
Business:  http://www.Phaseit.net
Personal:  http://phaseit.net/claird/home.html




More information about the Python-list mailing list