Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: Data flow vs logic flow?

by princepawn (Parson)
on Jun 02, 2001 at 07:11 UTC ( [id://85148]=note: print w/replies, xml ) Need Help??


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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://85148]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (2)
As of 2024-04-24 23:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found