On Mon, Jan 31, 2011 at 2:22 PM, Robert Park <[email protected]> wrote:
> On Mon, Jan 31, 2011 at 5:52 AM, Roberto Cavada <[email protected]> wrote:
>> Then I guess your GUI is necessarily very small. I cannot imagine a large
>> GUI all fitted into a module, and even within one single class. How do you
>> separate the GUI logics and the presentation layers? Can you split the GUI
>> into (interconnected, still decoupled) pieces? ( someone calls them
>> components.) If you have components, you can reuse/factorize code in
>> different parts of a single application, or you can rearrange the GUI for
>> another application.
>
> I don't totally follow you here. In "app.py" I have a single class
> with many methods. Some methods provide the actual application logic,
> and some methods are just boring signal handlers for various tedious
> GUI activities. However, I do import other classes that represent
> specific things (photo files, XML files, etc), and use them in
> sensible ways.

Wait, I think I'm starting to understand what you're saying. I do
understand the MVC concept because I have some experience with Ruby on
Rails.

Ok, what about this: What if I took my interesting application logic
methods, moved them into their own class, and then inherited from that
in the main app class? That would then make it essentially trivial to
make a second class that inherits the app logic code, which would
allow me to (for example) make a commandline interface to the same app
functionality without duplicating any of the app logic code.

Is that a sensible way to use inheritance in this case? Or is there
some larger picture that I'm missing?

Thanks again!

-- 
http://exolucere.ca
_______________________________________________
pygtk mailing list   [email protected]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://faq.pygtk.org/

Reply via email to