Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things

Re: Thorny design problem

by Codon (Friar)
on Sep 08, 2005 at 19:50 UTC ( #490301=note: print w/replies, xml ) Need Help??

in reply to Thorny design problem

This is difficult issue. It sounds as if you are going to have a handful of data collection schemes for your 100 data sources. This, combined with the desire to create a single, unified output format leads me to think Heirarchical. You will have some significant overlap in how you access the raw data per data source. All static web sites would have a url that you access. All FTP sites would have a remote server, login, password, and file path. All RDBMS will have similar credentials. In all cases, you will want to do the following:
  • fetch_raw_data
  • parse_raw_data
  • write_pased_data
  • This would make me go with something akin to:

    DataCollector DataCollector::Mechanized DataCollector::Mechanized::WalMart DataCollector::Mechanized::GeneralElectric DataCollector::RDBMS DataCollector::RDBMS::ExxonMobil DataCollector::FTP DataCollector::FTP::GeneralMotors DataCollector::Scrape DataCollector::Scrape::FordMotorCompany DataCollector::Scrape::CiscoSystemsInc . . . etc.

    Your driver program would then, unfortunately, need to know all of the DataCollector leaf classes or devise a method to dynamically load and run them. But for each of these classes, you could call the above mentioned methods. Those methods would make private method calls on down until you get to the ugly details in the individual implementation classes. These implementation classes would only need to know where it's going for data and how to pull the real data from raw data source. Up one level would be how to talk to the data source type, based on information in the implementation classes. Up in the top level is the detail of how to write out the data.

    I hope this makes sense, isn't too vague, etc. Good luck.

    Ivan Heffner
    Sr. Software Engineer, DAS Lead, Inc.

    Log In?

    What's my password?
    Create A New User
    Node Status?
    node history
    Node Type: note [id://490301]
    [ambrus]: And I don't much like syntax highlighters. If you need a syntax highlighter to understand your code, then your code is written unclear.
    [ambrus]: And if you need a syntax highlighter to color parenthesis green and numbers black and letters blue, then you're using the wrong font.
    [ambrus]: I have to tolerate syntax highlighters when other people use them, but I don't use them myself. And sorry for the rant.
    [GotToBTru]: I appreciate the ability to highlight matching brackets/ parentheses/ braces, both for my own code and the inconsistently indented code of others
    [Corion]: I like editors that automatically highlight the matching parenthesis (like % in vi), but that's roughly the extent to which I like editor support ;)
    [GotToBTru]: same here Corion.
    [Corion]: I tried for a short time (well, 8 hours now) to get Perl::Tidy set up but then found that it doesn't support (new-style) signatures and then stopped again ;))

    How do I use this? | Other CB clients
    Other Users?
    Others rifling through the Monastery: (12)
    As of 2017-02-27 12:47 GMT
    Find Nodes?
      Voting Booth?
      Before electricity was invented, what was the Electric Eel called?

      Results (385 votes). Check out past polls.