[Catalyst-dev] porting from another MVC framework

J. Shirley jshirley at gmail.com
Thu Nov 29 00:23:27 GMT 2007


On Nov 28, 2007 2:47 PM, Kieren Diment <diment at gmail.com> wrote:

>
> On 29 Nov 2007, at 09:24, Emily Heureux wrote:
>
> > Hi, we are trying to port from a homemade MVC framework to
> > Catalyst, but we
> > are new to Catalyst.  The old setup had logic written in Model and
> > View, and
> > very little in the Controller.  I do not understand how Catalyst is
> > set up
> > by default.  I cannot seem to have several perl modules within
> > View, but I
> > can put all the logic and perl modules I want into Controller.  My
> > understanding is that you don't want to put a bunch of logic in
> > Controller,
> > but instead in Model and View.  Is that not a typical way of going
> > about
> > designing in Catalyst?
> >
>
> Yes that is correct.
>
> I think it will be tricky for us to help you without more details.
> Can I suggest that you pop onto #catalyst at irc.perl.org and have a
> chat with people there.  How easy it is to move your old stuff over
> to catalyst depends on how clean the design of your existing code is,
> e.g. can you run your existing code without a web server, how does
> the url/action dispatch work, how are sessions/other state dealt with
> and so on.
>
> Also Matt Trout did some work on getting existing CGI scripts working
> under catalyst (Catalyst::Controller::WrapCGI - in catalyst svn - not
> on cpan yet due to lack of documentation) in order to get legacy
> maypole applications working under catalyst.  This might be of some
> help to you, but without more details it's difficult to say.
>
> By the way, if you do end up on irc, note that it can be a slightly
> unforgiving environment, but bear with us, listen to advice, and you
> should get some good quality help.
>


And say that you did post to the mailing list and were pointed to IRC
specifically.  There are a lot of people who join the IRC channel looking
for us to write their app for them :)

To quickly address the original question... you should have multiple views
that do a single thing, and the controller dispatches to each of them as
necessary.  The model should contain everything you need to do.

If you need more than one module in a view, you should probably use
different views... there is no limit on how many views you can use.

-J

-- =

J. Shirley :: jshirley at gmail.com :: Killing two stones with one bird...
http://www.toeat.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/catalyst-dev/attachments/20071128/5=
0fd4667/attachment.htm


More information about the Catalyst-dev mailing list