Advice from senior Members

Mike Driscoll kyosohma at gmail.com
Fri May 23 09:25:01 EDT 2008


On May 23, 8:02 am, flit <superf... at gmail.com> wrote:
> Hello All,
>
> I am looking for some experience from the senior members.
> Now I am doing a simple desktop application, this application will
> have 3 main functions:
>
> 1- Read information about the desktop system;
> 2- Interact with the user;
> 3- Send information to a server.
>
> The first part, reading information about the desktop system, is
> already done.
> And now I am starting to make the gui for the user, that is when the
> question appear:
> "What is the best way to make it? divide in files? by classes or
> functions?"
> I have now one big file with all functions to get the desktop
> information.
> Should I make one file for the visual functions (wxpython)? another
> for the server?
> Is productive to divide in files? what is the best way?
>
> It seems like a naive question, maybe easy one, but I am willing to
> enjoy the experience from the most senior programmers here.
>
> Thanks

I would investigate the MVC (model-view-controller) architecture. That
is what wxPython advocates as does TurboGears and Django. The idea is
to keep your view (the GUI) separate from the logic (the controller)
and (I think) the model controls the data access.

Anyway, it's explained much better at these sites:

http://wiki.wxpython.org/ModelViewController
http://wiki.wxpython.org/wxPython%20Patterns
http://en.wikipedia.org/wiki/Model-view-controller

I try to keep my GUI code as decoupled from my logic code as possible.

Mike



More information about the Python-list mailing list