Your skill will accomplish what the force of many cannot |
|
PerlMonks |
Generalizing table display for subclassby jest (Pilgrim) |
on Jul 29, 2003 at 08:32 UTC ( [id://278769]=perlquestion: print w/replies, xml ) | Need Help?? |
jest has asked for the wisdom of the Perl Monks concerning the following question: Oh wise monks, I seek enlightenment. I'm working on Yet Another app to display database info on the Web. I had originally written it in a highly repetitive way, with much copying of code across related programs, and now as I learn more about OO programming, I am trying to go through and clean it up by modularizing whatever I can. A part that I'm especially unhappy with is this, which is the main set of routines to display results. I've subclassed it, so that this class handles the display for any particular database, with the superclass handling the retrieval of info from the database, etc. Still, it's clear that even this is much bigger than it needs to be, and it's hard to make simple modifications to change the format, to generalize the code, etc. And it seems that there should be a better way to connect the columns to query with the fields displayed. I'd be grateful for suggestions for how to hide away any of this so that the subclass can be more streamlined. I'm only showing the relevant bits, but it should be enough for this purpose. Also, I know that there are about six zillion templating systems or the like that would make this easier, but for now, as I learn, I'd rather do it myself.
Thank you for your wisdom.
Back to
Seekers of Perl Wisdom
|
|