in reply to RE: RE: Module programming
in thread Module programming

Can you give real names to A, B, and C? What roles are they playing? Can B and C be specializations (subclasses) of A? Can B and C ask A what the current proxy setting is? If you had three people named A, B, and C, what would their job titles be, what would each of them know, and what would they have to get from each other?

A global variable is like person B riffling through the desk drawers belonging to person A just to get some info he knows. It's better to ask, not steal from behind. Because what happens if person A no longer puts it in the same drawer?

-- Randal L. Schwartz, Perl hacker

Replies are listed 'Best First'.
What A, B & C are
by Anonymous Monk on Oct 31, 2000 at 10:05 UTC
    Oh ok,.. What I plan to do a write perl modules to fetch headlines/news from sites and show on host website as dynamically generated pages. A = basic module that prints the HTML header and footer. B,C,D etc = module to print specific site's news (like /.) Each module B,C,D will need the proxy server name and port to access and retrieve the individual site backend file. This is the scenario.. (\/)(\/)
      Then what you need is "D", the one who knows how to go out to a site. A, B, and C all ask D to get a page given a URL. Case closed. No need for a global.

      -- Randal L. Schwartz, Perl hacker

        Great .. Why the heck did I not think about that ! ;) .. Thanks a lot.

        That design solved some of my other problems also.
        (\/)(\/)