in reply to Re^4: tt2 with perl cgi and a csv file
in thread tt2 with perl cgi and a csv file

I don't want to candy coat it. Catalyst has a learning curve, the docs are badly out of sync in a few places right now, and DBIx::Class, the ORM of choice, also has a learning curve, probably steeper. Then there are deployment issues. A CGI is a snap. Deploying a Cat app can be easy-ish to difficult depending on the host/env.

That said, once you're acquainted with the stuff it's just amazing how much more productive it makes you. Factor of 10 just thinking back to big projects without it. In fact, I did a gig in Cat in about two weeks that took something like 4 months to do without it and it was missing *many* safety and UI features the Cat app had.

One of the best things about Catalyst is it is, unlike Rails, agnostic about everything that plugs into it. You like YAML? Your config files can be in it. Or JSON, or XML, or init, or Apache style, or anything. You want plain DBI, CDBI, DBIC, Rose::DB? You have your pick. You have Oracle, MySQL, Postgres, SQLite? Bring it on. You want TT or HTML::Template, or Jemplate, or whatever! You've got it. The caveat there being: the Cat community leans pretty heavily toward TT and DBIx::Class. SQLite is used in a lot of examples for its simplicity and portability; it's great for testing too. Few folks are running applications with it.

It's a terrific community (or several, TT and DBIC have good lists too) with at least a couple of wonderful monks on the mailing lists. It's not always easy to get going but there is help available and once you're immersed, it really just raises your game tremendously.

Replies are listed 'Best First'.
Re^6: tt2 with perl cgi and a csv file
by Gokee2 (Acolyte) on Mar 28, 2008 at 06:50 UTC
    I guess I had a little to much fun sticking tags into my last post, I took so long you had another post waiting for me... So do I also need/want DBIx::Class? Once I am finished what files would I have? A .tt lib file for Catalyst and a .tt view file? Or a view file for edit one for search and one for edit? Although I kind of like going to the same url for list/search etc. Is there any quick start guide into this?

      Jump in here: Catalyst manual intro. It discusses the layout of files and application structure. I recommend DBIx::Class (abbreviated DBIC) and there is also Rose::DB looks great but I haven't tried yet. There is also a budding Catalyst wiki (that address might not be permanent) which has lots of goodies.

      Another thing I like about the Cat community is there is a serious approach to designing applications "correctly" (where correctly means extensibly and to standards). Something like a list/search would be best broken up. But it would be easy to use almost exactly the same code in the background (not duplicating it but "chaining" it or passing around a single result set and adding parameters as they are introduced... well, you see the learning curve starting to kick in).

        Ok its been a few days I looked over the intro and I went through the Tutorial. I also found the #catalyst and #tt chans on "MAGnet". I have been thinking about my design and wondering how catalyst fits into it all.

        I want to keep most of the site static (everything but archives) but I also need to generate the side bars for the other top links. Right now I have the side bars defined in a .tt lib that every page links to. So for example Interlinear used the lib interlinear.tt which has Introduction Matthew on and on in a manually defined AoH. This is fine for my little test however I want to have the side links generated from the file name.

        Then I need to somehow figure out how to sort the links. First of all the first part of every file name is a book of the bible the books need to be in order and a non-link title needs to be on the bar for every book there is content in. Then the 2nd part of the file name is the chapter and verse so that needs to be sorted within the correct book. Then for the name of the link the . should be replaced with : and last of all this link needs to be indented. This will be slightly different for every section under the top bar. I guess catalyst does not need to know about all this going on. Somehow though I have got to cram all that logic into tt.

        Or I should make a controller for catalyst with that logic built in then after letting you approve its bars (I want to have every change approved before it goes live anyway) catalyst could shove a config::general config file tt`s way and call ttree. That is if tt can use a config::general config file.

        Now back to archives and my, about to be started, catalyst app. I am thinking of a DBIC DB like in the Tutorial using mysql (I used mysql in the tutorial because thats whats on my server) that has a table with "id(auto incrementing, Primary key) file (the actual file on the file system) date (the first part of the file name) name (the rest of the file name)". I will have part one of my app that, checks for new files in the file drop, converts any new ones to html, adds them to the table, gets verification for its changes, has login (though a client side Certificates would be REALLY cool), and last but not least moves everything from its testground server to the production server. The hard part about this is going to be getting the testground mysql table synced with the production one. Then on the production server would be a striped down version with no login that just displays the file list has searching (sorting would be awesome) and links to the files and possible links to downloadable pdf/odf/doc files.

        Does this sound reasonable to you or have I made some bad design flaw that I should fix before making all this?

        Thanks!