473,287 Members | 1,582 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,287 software developers and data experts.

Advice from senior Members

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
Jun 27 '08 #1
2 831
On May 23, 8:02*am, flit <superf...@gmail.comwrote:
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
Jun 27 '08 #2
flit <su*******@gmail.comwrote:
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?
I would divide it into 3 files, one for the desktop info, one for the
server interaction and one for the GUI. Subdivide the files if they
start getting unmanageably long

My wx programs tend to be full of lots of little classes. I make
every object (pane, window, widget etc) its own class and glue them
all together in other classes.

I'd make your read the information file into probably a single class,
with each function a method. You can then either read all the
information on __init__ or as methods whichever seems best to you.
Your gui classes will then query this as appropriate (this is the MVC
as discussed by another poster).

You can write another text mode interface for the desktop info module
which prints things out in text format for testing.

Once you've divided your program up, you can start thinking about unit
tests. You can certainly unit test your desktop info gathering, and
your server interaction. It is hard to write tests for wx GUIs though
(but not impossible).

When you've finished you'll have 3 files full of classes. You may
have a few utility functions too.

--
Nick Craig-Wood <ni**@craig-wood.com-- http://www.craig-wood.com/nick
Jun 27 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Fraser | last post by:
Hi, I'm needing to update an xml file by inserting a new node. First I need to load the xml into a XmlDocument from file. In the first run, the file won't exist and I will have to create a...
4
by: Ken Varn | last post by:
I am displaying data from a SQL Server database on my ASP.NET web form. The data table that I am displaying is huge and it must be paged. What I would like to do is display 10 records at a time...
5
by: Lucas Tam | last post by:
Hi all, Does anyone know what an intermediate to senior .NET developer makes in Toronto, Canada? 2 - 3 years of experience with .NET, ~6 years with ASPs. 3 - 4 years of application programming...
7
by: gordon | last post by:
Hi I am learning C# from books. I am trying to understand the use of the word 'Static' on a method. When i look in the autos area (I often like to see what values are being resolved) i see...
22
by: Sandman | last post by:
So, I have this content management system I've developed myself. The system has a solid community part where members can register and then participate in forums, write weblogs and a ton of other...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: marcoviolo | last post by:
Dear all, I would like to implement on my worksheet an vlookup dynamic , that consider a change of pivot excel via win32com, from an external excel (without open it) and save the new file into a...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.