Using MVC when the model is dynamic

Cameron Laird claird at lairds.com
Wed Oct 1 17:17:12 EDT 2003


In article <3f7af8bf$0$564$b45e6eb0 at senator-bedfellow.mit.edu>,
Brian Kelley  <bkelley at wi.mit.edu> wrote:
			.
			.
			.
>1) I've recently become a fan of using the GUI's native events to 
>control state from the model to the view.  They are thread-safe and easy 
>to implement.  wxPython has a good example in their demo of doing this. 
>  See the Threads entry of "Process and Events"
>
>Model -> state is an observable ->| generates an event |<- View responds
			.
			.
			.
>Both of these gloss over the issue of how does the view talk to the 
>model.  The only real answer I have is polling.  The model must 
>occasionally poll for new instructions from the view or have it's own 
>event-style manager.
>
>Brian Kelley
>

My summary:  yes, what the original poster requested ab-
solutely is feasible, and even convenient, with Python.

If, that is, I understand him or her correctly.  I admit
to confusion, though.  He or she wrote:
# Also, examples where something like a simulation model running in its
# own thread sends fast updates to a GUI in near real-time.  The only
# examples I've seen, such as SimPy, wait until the model is finished
# running before outputting data.
# 
# Most MVC controls I see in java for example are only designed for
# infrequent user-driven changes, like resizing a window or mouse
# clicks, not cases where the underlying model is changing itself over
# time.
Was an interest for fast communications from user to model
desired? Or was the question solely along the lines of, is
there an architecture that'll permit the View to keep up
with the Model more-or-less in real time?
-- 

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