Organization of GUIs

Michael Mossey michaelmossey at gmail.com
Thu Dec 3 09:59:09 EST 2009


On Dec 3, 6:38 am, Lie Ryan <lie.1... at gmail.com> wrote:
> On 12/4/2009 12:44 AM, Michael Mossey wrote:
>
> > I have a question about typical organization of GUIs. I will be using
> > PyQt.
>
> Model-View-Controller (MVC) pattern.
>
> Model - all the business logic lives in the model.
> View - your GUI
> Controller - Takes input
>
> Controller notifies Model if there is user input; Model notifies View if
> there is an update in the model; View "notifies" user if there is an
> update in the model; User "notifies" controller of the changes wanted.
>
> http://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93controller

I'm aware of Model-View-Controller, but my question is broader than
that for a couple reasons:

View can be fine-grained. Often the View consists of a number of GUI
objects. Some people write this in a democratic arrangement---they all
talk to each other. This can make analyzing system behavior
complicated. Hence my proposal for a hierarchy.

Also, often different parts of the Model talk to different parts of
the View. The question, then, is whether both the Model and View
should be structured hierarchically so that all messages pass through
a "master" or "root" object before going to the other Model/View, and
messages within a Model or View should only move along the hierarchy.

In other words, you can easily make a complete mess of MVC.



More information about the Python-list mailing list