Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

(jeffa) Re: RFC: CGI::Tables

by jeffa (Chancellor)
on May 07, 2003 at 22:47 UTC ( #256407=note: print w/ replies, xml ) Need Help??


in reply to RFC: CGI::Tables

Did you not see my attempt at this problem: DBIx::XHTML_Table? You can even use that module to create a "Spreadsheet CGI". However, mine is more tied to DBI ... but you can always pass the constructor an AoA without needing a database.

This does make me wonder if there should be a base class that both of our modules could use ... on another note, i would like to see your module replace HTML::Table, which i really don't care for. The author actually tries to handle each attribute individually instead of generically allowing attributes to 'handle themselves' ... shudder

Anyhoo, check out my module ... there are some neat features you are welcome to steal. :) (like rotating attributes and callbacks for each cell)

Oh yeah, i almost forgot -- if you want to investigate the HTML::Template solution, be sure and check out my Dynamic HTML::Template Database Template. Again, it was designed to be generic and to be used with a database, but you can always modify it to fit your specific needs.

jeffa

L-LL-L--L-LL-L--L-LL-L--
-R--R-RR-R--R-RR-R--R-RR
B--B--B--B--B--B--B--B--
H---H---H---H---H---H---
(the triplet paradiddle with high-hat)


Comment on (jeffa) Re: RFC: CGI::Tables
Re: (jeffa) Re: RFC: CGI::Tables
by elusion (Curate) on May 08, 2003 at 01:17 UTC
    I hadn't seen DBIx::XHTML_Table before. It is the 96th result returned in a CPAN search for "html table". I rarely search to the 10th page. Truth be told, there are entirely too many results returned. Many of them seem to do the same thing, and most of them also seem poorly designed, IMOH.

    <rant>

    Some people will naturally like templates better. That's fine, but let's ignore that at the moment, because I personally don't care much for them. They have their place, but most of the time it's not with me.

    Where is the best place to put a module like this? I see them in all different namespaces: DBIx, HTML, Table, Text, CGI. Where would it actually belong? If it's made more generic with different output options? What if you decide you want to expand it with other HTML functions? This is a general problem with CPAN, I think. Reusable code doesn't fit well in a hierarchy.

    Now what if different people have different ideas of what a good interface would be? The first module claims a good name, and the second really has no place.

    Suppose, for instance that I decide I don't like the way CGI.pm works. I decide that I want to redesign it. Sure, reinventing the wheel can be bad, but there's always the possibility of improvement. What would I name my module?

    </rant>

    It's really hard to find the right module sometimes. Too hard. I suppose it's even harder to write one.

    elusion : http://matt.diephouse.com

      It's curious that in the same burst you rant about too many modules being on CPAN and having them poorly designed, but you offer no feedback at all on DBIx::XHTML_Table, which apparently has support for using an AoA to build the table, which I think is supposed by be one of the neat features of your module-- the easy ability to add a column.

      My suggestion is that you if you are concerned about the proliferation of semi-useful modules on CPAN, look hard at all the alternatives to your own module that you could contribute to before starting yet-another.

      I get the sense that many modules are maintained by primarily one person who would be glad to have help, and we would all benefit by having fewer high quality modules to wade through.

      If you remain confident your module is filling a unique niche, I think the module-authors@perl.org mailing list is the appropriate place to ask about potential names.

      Mark

        Like I said, I hadn't seen DBIx::XHTML_Table before. It was the 96th result returned. Ten pages. I looked for something that filled the need I had, but couldn't find it. I'm not gonna look at every module on CPAN before writing my own. Here is the AoA interface to DBIx::XHTML_Table:
        my $rows = [ [ qw(Head1 Head2 Head3) ], [ qw(foo bar baz) ], [ qw(one two three) ], [ qw(un deux trois) ] ]; my $table = DBIx::XHTML_Table->new($rows);
        It's almost identical to the first way of arranging data in my module, but quite different than the other two. The second two are the ones I consider neat. You supply an array and the number of columns or rows that you want and it builds the table for you.

        As to contacting module authors, one of the main rules of module writing is "don't change the interface." That makes it rather difficult to contribute to an out of alpha/beta module. I could send my code, but its interface is entirely diferent, so it wouldn't do much good to try to incorporate it.

        elusion : http://matt.diephouse.com

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (6)
As of 2014-10-02 04:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    What is your favourite meta-syntactic variable name?














    Results (49 votes), past polls