ObjectA calling ObjectB

Midas MidasOneTwo at hotmail.nospam.com
Sat Dec 27 18:27:05 EST 2003


By the way, thanks for assisting.

Here's my plan:

My main module would have three code sections:

Part 1)  Create 10 new assorted objects
Part 2)  Link up the objects, somehow, so they can communicate with each other directly, like parts of an electrical circuit.
Part 3)  Call the first object, which calls another, etc. like an electrical circuit.

To change the circuit, I would only change part 2 and perhaps part 3.

For example, ObjectX could have an input, for a string, and two outputs.
If the input is "TurnOnS", it calls ObjectY.Input3
If the input is "TurnOnT", it calls ObjectZ.Input7

ObjectX would call either, ObjectY.Input3 or ObjectZ.Input7, because it was connected that way in part 2.

I could then later change part 2 so ObjectX called either ObjectE.Input2 or ObjectF.Input9
In other words, I could "re-wire" the circuit without changing anything in the objects.

Midas

On Sat, 27 Dec 2003 22:42:21 +0100, Lawrence Oluyede <raims at dot.com> wrote:

>Mmm what do you mean with "to be told, at run time, which object
>to call and which method to call" ?




More information about the Python-list mailing list