Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

MVC & Perl

by lomSpace (Scribe)
on Jul 15, 2010 at 16:11 UTC ( [id://849800]=perlquestion: print w/replies, xml ) Need Help??

lomSpace has asked for the wisdom of the Perl Monks concerning the following question:

Hello!,
I am designing a relational database with a web interface. I am considering
implementing model-view-controller architecture. I came across Catalyst
and wanted to know if the Monks think that this is a good choice.

LomSpace

Replies are listed 'Best First'.
Re: MVC & Perl
by jkva (Chaplain) on Jul 16, 2010 at 09:56 UTC

    Hi LomSpace,

    I'm currently using Catalyst to build the website for my hometown's firefighter department. I had to get used to it, but once the idea of MVC with Moose and DBIx::Class sets in, it's very easy to rapidly build a web application with it.

    I did buy the official Catalyst book, but that didn't help me much. I really understood it after reading the Catalyst Tutorial/Manual on CPAN, so I'd suggest you check that out to see if it's something you'd like.

    Cheers!

      Which Catalyst book did you purchase?
      Thanks a lot jkva!
      LomSpace
Re: MVC & Perl
by sierpinski (Chaplain) on Jul 15, 2010 at 17:37 UTC
    I'm far from an expert in Catalyst (only started trying to use it within the past week myself) but I would guess that it depends on what type of site you're looking at developing. Is Catalyst right for you? It'd probably be overkill for a very small site, but if you want a good framework, I've heard Catalyst is very good at the MVC architecture. It probably also depends on time, and whether or not you know how to use it, or how long it would take to learn it. Based on the number of dependency modules I had to install for Catalyst, I'm guessing it can be pretty complex.

    Hopefully one of the more Catalyst-experienced monks will chime in.
Re: MVC & Perl
by aquarium (Curate) on Jul 16, 2010 at 04:41 UTC
    I've only read about Catalyst and other MVC perl frameworks, and i've done limited MVC programming in non-perl setups. As has been gently pointed out, MVC frameworks incur a steep learning curve and fair amount of overhead for the conveniences and structure provided.
    i don't want to detract you from learning MVC Catalyst, but it may be overkill, as already pointed out.
    You can do all the right kind of things with the database if you apply the relational methods as covered in related theory by various authors etc. In other words if you get the design of the program and database correct, there's no necessity to use an MVC framework. In practice this means making sure your database is normalized (3rd normal form) as much as possible, and carry out CRUD (Create Read Update Delete) analysis etc. as per relational theory and guidelines. A lot of programmers i've come across (with or without university degree) don't know these basics, and end up with non-maintainable and buggy programs from conception thru implementation. Some even think that a relational database is merely a different form of a spreadsheet, which it is not.
    Even if the project is quite sizeable, additional analysis and design using Data Flow Diagrams properly--for example--you can design and code a well behaved and maintainable data centric application.
    of course using MVC Catalyst doesn't mean that you can automatically forget about all the basic relational requisites as mentioned above, and I humbly commend you for undertaking to learn MVC in the first place.
    the hardest line to type correctly is: stty erase ^H
      Hi aquarium,
      I am building a rdbs to house image and time series data from assays. I will be employing DFDs
      and employing relational database basics.

      Thanks for your response!
      LomSpace
Re: MVC & Perl
by stonecolddevin (Parson) on Jul 16, 2010 at 19:16 UTC

    I recommend Catalyst because it's more glue than a framework. You can stick to most your traditional coding ideals and screw them into catalyst through a model/view/controller when you're ready for them to see the web. Catalyst has a LOT of options for helping you do this as well.

    mtfnpy

Re: MVC & Perl
by CountZero (Bishop) on Jul 16, 2010 at 16:45 UTC
    I have been using Catalyst from its very early and humble beginnings when it was still very much a "work in progress", but it now is a robust, flexible and "enterprise" class MVC-framework, second to none.

    There is some learning curve to master, but if you follow the tutorials provided in its documentation, you will have a site up-and-running before you know it.

    Do also invest some time in getting used to DBIx::Class for the database part of your site and Template::Toolkit for the templating of your HTML.

    CountZero

    A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James

      Thanks CountZero!
      LomSpace
Re: MVC & Perl
by SilasTheMonk (Chaplain) on Jul 16, 2010 at 09:30 UTC
    Catalyst certainly comes in job adverts a lot. I would learn it just to develop your future career if nothing else.
Re: MVC & Perl
by coldguy (Sexton) on Jul 16, 2010 at 21:27 UTC

    My experience with Catalyst is stale by about a year (switched jobs) but I liked it quite a lot when I was using it. I can only imagine it's gotten even better since then. It might be overkill for something extremely simple like a form mailer, but if, in the more likely case, you're doing anything involving a database or more than a very small handful of pages, then Catalyst will save you a ton of work. It compares very favorably to other web application frameworks such as ASP.NET or Rails.

    The one criticism I would have is that the API seemed to evolve very quickly. By the time I had moved on, some of the ways of doing things that I initially learned were no longer the recommended ways (although they still worked.) I don't know if they've slowed down since then.

Re: MVC & Perl
by james2vegas (Chaplain) on Jul 17, 2010 at 07:56 UTC
    You might want to look at the less popular but powerful Gantry framework (and Bigtop, 'A web application data language processor'), especially considering your stated goal of designing a relational database web interface. Look especially at A Holiday Gantry Application.

    Also worth considering, MVC-wise, is CGI-Application, a more traditional CGI-based framework, but one that can do MVC, as well as run in more constrained environments (especially compared to Catalyst).
Re: MVC & Perl
by sundialsvc4 (Abbot) on Jul 20, 2010 at 03:29 UTC

    It may well be that there is nowhere in the run-of-the-mill Perl world where the philosophy of “TMTOWTDI” is more thoroughly represented, than in the realm of Web application frameworks.   You will find dozens of them.   Catalyst is one.

    The Perl environment has an uncommon wealth of powerful, practical frameworks.   It would be rather grossly unfair to any of them to “swiftly pass judgment” upon them, although you can be certain that this is precisely what will happen!  :-D

    If you are coming from, say, the PHP world, you might not be used to this sort of thing.   Perl is a considerably more advanced language than PHP is, in terms of its intended scope and architecture.   (“IMHO,” of course!)   And I actually don’t intend that as a slight.   Honest.   I don’t.   Really.   ;-)

    The best thing for you to do, is simply to consider your various options carefully.   Consider what your application requirements are, and attempt to select a solution that fits those particular needs best... according to you.

      Thanks sundialsvc4!
      LomSpace
Re: MVC & Perl
by metaperl (Curate) on Jul 21, 2010 at 18:23 UTC

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (5)
As of 2024-04-25 14:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found