Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Modules that significantly contribute to Laziness

by Whitehawke (Pilgrim)
on May 24, 2005 at 15:22 UTC ( [id://460029]=perlmeditation: print w/replies, xml ) Need Help??

I'm in the design phase of a large Perl application, storing medical records. It's a green-field project and I have complete latitude to use whatever technologies I want; I've chosen to make it web-based but it isn't well enough defined at this point to say much more about it.

I'm looking to maximize my Laziness. I've been searching CPAN for modules that are mature, stable, and will handle some significant part of the job for me. Below is the list of what I've found.

I know that the specification information I've provided is non-existent, but all large-scale web-based apps that store information about people are going to have certain similarities. Can anyone recommend other modules/programs/whatever that I should be looking at?

Apache
The web/application server.
PostgreSQL
The DB backend.
Tangram
Provides easy object persistence
Alzabo
Generate and manage DB schemas easily
Template Toolkit
Front-end presentation
Log::Log4perl
Clean and powerful logging
Poe
Back end processing. Based on the various systems I've researched, this seems like my best choice for building the back end. I am unsure, however, if Poe will help much with Laziness.

Replies are listed 'Best First'.
Re: Modules that significantly contribute to Laziness
by dragonchild (Archbishop) on May 24, 2005 at 15:26 UTC

    Start with that. If you need more, you'll find it.


    • In general, if you think something isn't in Perl, try it out, because it usually is. :-)
    • "What is the sound of Perl? Is it not the sound of a wall that people have stopped banging their heads against?"

      Well, as I mentioned, I had already decided to use Template Toolkit and Log::Log4Perl, so I'm glad you recommend them.

      DBI is lower level than I'm looking for...it is pretty much the lowest level at which it is sane to write DB code in Perl, and my goal is to be well above that level. (To go any lower you'd need to shell out or write XS to a driver--which is effectively what the DBD modules do.) The reason I chose Tangram is because it means that, for a certain category of DB interactions (object persistence) I can completely ignore the DB.

      Thanks for the reminder about Class::DBI; I'll compare/contrast it against Tangram.

      Regarding CGI::Application--what is your experience with it in terms of user interface speed? That is going to be a major requirement of this project...the interface must feel as snappy as a locally-running application, or it will be rejected out of hand.

        CGI::Application is very simple and light. It will not slow down your project. Database access is the most likely place you will see performance problems.
        I'm echoing perrin here - DB access is typically 80-90% of the time to process an HTML request. C::A is actually nicely optimized and is very light. If you're worried about speed, I'd seriously look at CDBI over Tangram - I think it's lighter, which may improve performance somewhat.

        • In general, if you think something isn't in Perl, try it out, because it usually is. :-)
        • "What is the sound of Perl? Is it not the sound of a wall that people have stopped banging their heads against?"
Re: Modules that significantly contribute to Laziness
by redhotpenguin (Deacon) on May 24, 2005 at 15:48 UTC
    May I recommend Test::More? Since you're dealing with medical records testing is definitely a necessity :)
      Heh. Absolutely. Actually, the only reason that this wasn't included in the list is because I regard it as a 'must have' for *every* project...to the point where I don't even think about it. Which, of course, is an assumption on my part...I should make sure to keep my eyes open for when the Next Big Thing in testing comes along.
Re: Modules that significantly contribute to Laziness
by astroboy (Chaplain) on May 24, 2005 at 18:11 UTC

    If you're into laziness then you should consider my favourite CGI::Application plugin - CGI::Application::Plugin::ValidateRM. It's a wrapper around Data::FormValidator and HTML::FillInForm. I used to hate the tedious nature of validating user input and then writing the errors etc, but with this plugin all you do is define your validation rules in a hash, and it generates the error messages and represents the form with the original values entered. This has really helped my productivity.

      This is exactly the kind of thing I was looking to get with this node. Thanks very much.
Re: Modules that significantly contribute to Laziness
by siracusa (Friar) on May 24, 2005 at 16:30 UTC

    If you're doing anything remotely complex with HTML forms, and/or intend to reuse similar forms in several places, I highly recommend checking out Rose::HTML::Objects...and not just because I'm the author :) Manually dealing with the minutia of HTML forms drives me bonkers. For large web applications, the blessed sanity that comes from having a library of reusable, feature-rich fields and forms should not be underestimated.

    If you're feeling adventurous, you might want to also look at Rose::DB::Object for another alternative database/object mapping module. It doesn't handle schemas at all (so stick with Alzabo there) and is not very mature, but it does have some laziness-friendly features that Class::DBI and Tangram lack. In particular, it will free you from worrying about parsing/formatting dates, arrays, and other odd database-specific column values. It also happens to support PostgreSQL's CHKPASS column type, which is handy for transparent encryption of passwords and such. (Look in the "contrib" directory in the PostgreSQL source code for chkpass support; it is not installed by default.)

    As for UI speed, I recommend investigating the use of XMLHttpRequest. I'm not sure if there are any Perl modules that will help with this, since it's a client-side JavaScript thing, but it's really the only way to approach the UI speed of a local application.

      I'm not sure if there are any Perl modules that will help with this, since it's a client-side JavaScript thing

      There are some nice modules that help out with XMLHttpRequest. Have a look at this node

Re: Modules that significantly contribute to Laziness
by wazoox (Prior) on May 24, 2005 at 15:42 UTC
    If your application is used a lot to enter new records in a database, make reports, etc, then Maypole is a must-have for the lazy developer...
      Super-Lazy, *if* you can get it to work!...



      This is not a Signature...

      I did do some research on Maypole, actually. It seems ideal in every way except one: I can't see much proof that it is still under active development, or that it has a significant user/developer community to turn to for support. Am I wrong in those impressions? I would like to be, because it seems really desirable in all other regards--rather more so than Poe, which has active development and a significant community, but appears to be rather lower-level.

        Maypole is very recent (April 2004) is a one-man work. If it works fine (and it seems it does), why bother? It's maintanable by one man (obviously), and it works right now.
        BTW I'm pretty sure it's quite active, the latest update is from january 2005, not so long ago, and maypole has even given birth to a brand new nice framework :Catalyst, which may be interesting too.
Re: Modules that significantly contribute to Laziness
by buckaduck (Chaplain) on May 24, 2005 at 19:30 UTC
    This depends on how you set up your application, but when I have a web-based application with a database backend, I often use Data::Table for maximum laziness. After performing a database query, you can filter, sort, reformat, etc. and then print the resulting data as an HTML table. There are plenty of options for formatting the HTML table nicely.

    A lazy example (based on the module's documentation):

    use Data::Table; use DBI; my $dbh= DBI->connect("DBI:mysql:test", "test", "") or die $DBI::errstr; my $minAge = 10; my $t = Data::Table::fromSQL ( $dbh, "select * from mytable where age >= ?", [$minAge], ); # Print out an HTML Table. print $t->html;

    buckaduck

Re: Modules that significantly contribute to Laziness
by samtregar (Abbot) on May 24, 2005 at 23:50 UTC
    Will you need a search interface? If so I highly recommend you check out CGI::Application::Search. It just doesn't get any simpler than that! It saved me at least a week of work on my current project.

    -sam

Re: Modules that significantly contribute to Laziness
by merlyn (Sage) on May 25, 2005 at 12:14 UTC
Re: Modules that significantly contribute to Laziness
by adamk (Chaplain) on May 25, 2005 at 12:01 UTC
    And in addition to the big stuff, don't forget the judicious use of Util modules.

    Scalar::Util, List::Util, List::MoreUtil and Params::Util all provide a bunch of light, tight, fast things that make life a lot more livable.

    For lazy testing so you can just dump tests in next to the code they are testing wherever you like, you might want to consider Test::Inline, although the original version (current production version) is not very lazy for more than one file, and the new Test::Inline 2.0 (which is FAR more lazy) is hovering at release candidates, and not production yet.
Re: Modules that significantly contribute to Laziness
by Ultra (Hermit) on May 24, 2005 at 18:42 UTC
    POE will kill your Laziness in the short term as the Cookbook and this Guide will give you something to work on ;-)
    In the long term, my guess is that it would help a lot your Laziness as it would be easy to maintaint and/or modify and/or extend your backend to suit your future (yet unknown) needs.
    Dodge This!
Re: Modules that significantly contribute to Laziness
by brian_d_foy (Abbot) on May 25, 2005 at 19:15 UTC

    I don't think using modules can be called Laziness: writing modules is Laziness. It's doing more work than you have to for the current problem so you do less work for future ones. The gains from Laziness are in the long term and there is some loss in the short term. People often miss that little bit of irony. :)

    --
    brian d foy <brian@stonehenge.com>
Re: Modules that significantly contribute to Laziness
by Anonymous Monk on May 25, 2005 at 12:57 UTC
    http://formbuilder.org/
      CGI::FormBuilder -- great timesaver, yes! ++
Re: Modules that significantly contribute to Laziness
by andye (Curate) on May 29, 2005 at 10:39 UTC
    Perhaps this just went without saying, but in a setup like this I'd certainly add:

    - mod_perl
    - Apache::DBI

    as both of these should make things somewhat nippier* without really adding any work.

    hth, a.

    * faster - more responsive.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlmeditation [id://460029]
Approved by holli
Front-paged by holli
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (4)
As of 2024-03-19 07:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found