[Catalyst] sane migration to catalyst

Daniel McBrearty danielmcbrearty at gmail.com
Tue Mar 14 22:05:20 CET 2006


Thanks one and all. Some tremendous advice. (One of the factors that led to
teh choice of staying with perl/cat over a move to ruby/rails was the
general high level of knowledge in the perl community.)

My app is perl with CGI::FastTemplate on mysql. I hand wrote all the sql
interface, but tried to keep it clean of application (bus) logic. There is a
certain amount of checking of invariants in there, that's about it.

In amongst all this is a need to gradually upgrade the db schema, and also
shift to postgre. I'm not particularly a BDUF fan, but I will have a shot at
mapping how I want the schema to look in a years time, just as a guiding
light. If that concept changes over time, that'll be fine - nothing is in
stone. But getting the schema right is a big part of teh battle.

I'm going to reread your posts in the morning, give them a bit of settling
time. Once again, thanks.

Daniel

On 3/14/06, Len Jaffe <lenjaffe at jaffesystems.com> wrote:
>
> Afterinnumerable software migrations, I can tell you
> that you want to migrate piece by piece.
>
> I'll spare you all the long anecdote, but I will say,
> that the fewer things you change at any given time,
> the easier it will be to track down the source of the
> new error.  One axis of change at a time.
>
> Think MVC.  Think of your web app as:
> 1) messing with parms.
> 2) picking the biz logic to run (dispatcher)
> 3) running biz logic [C]
>    i) manipulating data [M]
>   ii) rendering output [V]
>
> Since catalyst is going to handle a lot of 1 & 2, you
> shoudl plan your migration based on 3.  Start by
> picking a view, or a model.
>
> For Model, choose your ORM [CBID, or DBIC], get it
> working, stand-alone - write the modules, and write
> some Test::More code to exercise them.  Then make a
> copy of one of your curent functions, and replace your
> DBI calls with your ORM.
>
> What you want to do is figure out what ORM methods
> work best for replacing your current db access.
>
> For View, pic one, and as above, make a copy of a
> working page, and replace your current method of HTML
> generation with it.
>
> Once you've got the hang of your new ORM and your new
> View renderer, your controller logic should be a snap
> to convert into catalyst methods.
>
> Now I don't know how your app is built.  If it is
> DBI/CGI/print, then converting to an ORM will
> probabaly be easiest/fastest.  Nothing feels as good
> as success and momentum.  If you ar eusing print
> statements, converting to a templating system may be a
> bit harder or more complex/time-consuming.  There are
> several good ones in Perl.  TT is very popular, and
> for good reason.
> Text::Template is also good, in a pure-perl-ish kind
> of way.  You've no doubt also seen posts encouraging
> you to adopt seamstress (no opinion, never used it),
> and there's a HTML::Widget party going on right here.
>
> My advice is also to stay in your comfort zone.  Pick
> the view that looks like you'll be able to get your
> work done with the least depletion in your headache
> medicine supply.  You're shifting models.  While you
> cope with a new model, you shouldn't try to cope with
> a bunch of other new APIs at the same time.
>
> Once you've adopted a Model, and a view, you're pretty
> much MVC, you're just not using a cool framework. Now
> you're home free. The catalyst examples are very good
> at explaining the basics of controller logic.
>
> I myself came to Catalyst with some CDBI experience
> and and having used three different view modules, I
> found it simple to get my prototype application under
> Catalyst very quickly*.
>
> Len.
>
> [ * That was under solaris.  oddly enough, I can't get
> a clean install of all of the catalyst stuff I need on
> either of: fedora 3, cygwin, WinXP/ActiveState.
> There's always something that doesn't want to install.
> :-)]
>
> Leonard A. Jaffe     lenjaffe at jaffesystems.com
> Leonard Jaffe Computer Systems Consulting Ltd.
> Columbus, OH, USA 614-404-4214 F: 530-380-7423
>
> _______________________________________________
> Catalyst mailing list
> Catalyst at lists.rawmode.org
> http://lists.rawmode.org/mailman/listinfo/catalyst
>



--
Daniel McBrearty
email : danielmcbrearty at gmail.com
www.engoi.com : the multi - language vocab trainer
BTW : 0873928131
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.rawmode.org/pipermail/catalyst/attachments/20060314/f25c8256/attachment.htm 


More information about the Catalyst mailing list