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 <[EMAIL PROTECTED]> wrote:
On 6/28/06, Eduardo Oliveros <[EMAIL PROTECTED]> 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@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/
_______________________________________________
List: Catalyst@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/

Reply via email to