[Tutor] communication between class instances

Poor Yorick gp@pooryorick.com
Thu Dec 5 19:17:02 2002


Magnus Lycka wrote:

 >
 > I'm not sure what you mean that "app" should be but I try to
 > make sure that my program logic is unaware of the GUI.
 >

The classes were just sort of a pseudocode for the structure I've
created.  The class that I called GUI just contains all the code for the
user interface.  I am struggling with just the thing you mentioned.  How
do I keep the program logic unaware of the GUI when the program depends
on information gathered by the GUI widgets.  Generally, the concept that
I seem to be butting up against is how should instances of objects
communicate with each other?  Of course I can have them exchange
references to each other, but if I do that, is there really a point to
keeping them separate as classes?  And what happens to flow control when
the program instance is doing its own thing and at the same time widgets
are generating calls to methods of the program instance?  G. Rodriguez
mentioned that exchanging references between instances creates a cycle,
but what is the alternative?

Poor Yorick
gp@pooryorick.com