I'm writing some data analysis software and decided to use such approach:
epn:
model/data.py <- Model definition
model/reader.py <- How to read data into model
view/gui.py <- main gui frame (wx)
view/dialogs.py <- different dialogs (wx)
epn.py <- controller
For communication between gui and data I used wx.lib.pubsub. So when button 'Modulation index' is pressed, epn.py catches the message and orders:
self.view.control_panel.displayModulationIndex(self.data.getModulationIndex())
where self.data.getModulationIndex() is:
def getModulationIndex(self):
m = self.mean_flux
f = self.fluxes
# other things
On the other hand I can write it as:
def getModulationIndex(self, m, f)
# other things
and call it as:
m = self.data.mean_flux
f = self.data.fluxes
self.view.control_panel.displayModulationIndex(self.data.getModulationIndex(m, f))
From my point of view the first example is better (shorter, encapsulated, more error-proof). But it is harder to test it --- you can't just call the method on some mock objects.
hope this one is clear
regards
chriss