in reply to Re^2: Module hierarchy help
in thread Module hierarchy help
I guess without knowing a bit more about the kind of data you seek to retrieve and how you intend to parse it, I can't give you very good advice.
But it seems to me as though you are wanting to repeatedly execute a small handful of fairly basic tasks:
It seems to me that all of those methods could be part of your Robot::Base. Admittedly, you might have to subclass in some cases, but it would seem to me that the website URL, the regular expression(s) or other identifying tag names for locating the proper information, the formatting rules and the SQL statement handles could all be part of your configuration, so that you are executing the same code for each website with different configuration parameters.
Heck, the best way might be to try it out for a half-dozen of the sites, and see if you can abstract the common code and come up with a solution that is general enough -- if not, then you may end up writing distinct code for each of the 50 data sources. If you end up doing it that way, though, I would hate to be the poor guy who comes along after you and has to maintain it. :)
Fifty subclasses is beyond my limit of how granular I am willing to get ... what do you do if someone asks you to go to 100 websites, or 1000? When you find yourself writing so much code for essentially the same tasks, you have to ask yourself, "Isn't there some general solution that would save me from so much duplicate effort?". I usually ask myself that question if I have more than five or six subclasses at a particular level.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Module hierarchy help
by 2ge (Scribe) on Jul 27, 2006 at 14:30 UTC | |
by Asim (Hermit) on Jul 27, 2006 at 15:44 UTC | |
by 2ge (Scribe) on Jul 27, 2006 at 17:05 UTC |