in reply to Data flow vs logic flow?

Well, the idea of to make ModuleThree as independent and ignorant as possible about where it's input is coming from, so that even though right now you know that it's being used with UserInput, one day it could be used with data from a CGI webpage, or from a database or whatever, so I would suggest that MainModule pass them to ModuleThree.

ModuleThree will also be easier to test since you will be able to feed it input from anywhere.

Replies are listed 'Best First'.
Re: Re: Data flow vs logic flow?
by AidanLee (Chaplain) on Jun 02, 2001 at 20:11 UTC

    Right. A good rule of thumb i use to keep my module interfaces clean is to make them selectively ignorant of the world around them. They can know where to send data to, but not where data is coming from.

    When i say where a module sends data to, I am referring to files/databases, functions that module calls, not the return values on its own functions.