[Catalyst] Program the logic

Zbigniew Lukasiak zzbbyy at gmail.com
Thu Jun 29 09:37:58 CEST 2006


I dont' agree with the statement that all the application logic should go
into the Controller.  In my opinion in the Controller you should have only
the code that is directly web related - all the rest should go into the
Model.  This way you can call your business logic from a cron script without
the overhead of all the web stuff.

--
Zbyszek

On 6/28/06, Nilson Santos Figueiredo Junior <acid06 at gmail.com> wrote:
>
> On 6/28/06, Eduardo Oliveros <eduardo.oliveros at gmail.com> wrote:
> > I'm planning to program the logic of the application (the Model in
> > MVC) previously to start with web page and the presentation.
>
> Actually, the Controller is what is supposed to drive the logic of the
> application. The model is really just that: the model. It's usually
> mapped to some kind of storage engine such as a RDBMS. Many strong
> advocates of MVC specifically try to leave business logic out of the
> database.
>
> > What I see is that what Catalyst calls Model is just the Objects that
> > map with the tables in the DDBB. And the logic of the application are
> > developed in the Actions (in fact linked to the web application).
>
> You'll see that it's "a little" more than that (at least when you're
> using DBIx::Class - Class::DBI can't even be compared feature-wise
> nowadays).
>
> > I know is difficult in practice to separate both worlds (logic from
> > the presentation) but that is the false promise of the MVC pattern :).
>
> Not really. It's something somewhat straight-forward when using
> something like Catalyst. All you've got to do is resist the temptation
> of polluting your controllers with things that really should be in
> your views. But sometimes it's even worth it.
>
> -Nilson Santos F. Jr.
>
> _______________________________________________
> List: Catalyst at lists.rawmode.org
> Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
> Searchable archive:
> http://www.mail-archive.com/catalyst@lists.rawmode.org/
> Dev site: http://dev.catalyst.perl.org/
>



-- 
Zbigniew Lukasiak
http://brudnopis.blogspot.com/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.rawmode.org/pipermail/catalyst/attachments/20060629/ad7e3266/attachment.htm 


More information about the Catalyst mailing list