in reply to Re: Class::DBI -- does it get any easier?
in thread Class::DBI -- does it get any easier?

While I can recommend Class::DBI::Loader, I can only discourage people from using Class::DBI::Loader::Relationship, which I consider underdocumented and over-hyped. It is/was nice and convincing for Simons live demonstration of how to create a web frontend for a database in under 20 lines of code, but using english as a configuration language for your relationships is really error prone. The error messages or diagnostics (not) output by cdbi:l:r don't help either, and unless you have taken a long look at the source code, it's not easy to modify the examples to suit your actual situation. A more formal syntax would help here and remove the heavy dependency on a good and judicous choice of words made by the program author while still preserving the wanted clarity.

The module relies on the very simple-minded yet totally undocumented assumption that all phrases will be of the form single-noun verb (a|many) noun - once you glean this from the source code, you can start using it, but the time is better invested in some less magic method of setting things up.

Adding to the situation is, that the module is not maintained anymore, and if I stepped up as maintainer of it, I would mainly depreciate the use of the module and replace it by something with a more formal syntax:

brewery 1:n beer # "a brewery produces many beers" beer m:n(handpump) pub # "a pub has beers on handpumps"

Replies are listed 'Best First'.
Re^3: Class::DBI -- does it get any easier?
by davorg (Chancellor) on Nov 12, 2004 at 10:10 UTC

    I find the module useful, tho' I recognise many of the shortcomings that you mention. I've asked to take over maintenance of the module, and if I get it I'll certainly be interested in any suggestions for improvement.

    --
    <http://www.dave.org.uk>

    "The first rule of Perl club is you do not talk about Perl club."
    -- Chip Salzenberg