[Catalyst] question from tutorial - does creating HTML in a controller using HTML::Widget violate MVC?

Nilson Santos Figueiredo Junior acid06 at gmail.com
Wed Dec 6 01:51:52 GMT 2006


On 12/5/06, John Siracusa <siracusa at mindspring.com> wrote:
> What would this "Perl code layer" be responsible for doing?  Can you give
> some examples?

The most obvious example is data set sorting.

The sort order is something presentation related and, thus, shouldn't
be in your controller (at least from my POV). Of course, you *can*
sort inside your templates but I'd rather do it using Perl code since
I'd end up having cleaner templates.

Depending on how you use it, there might also be a performance gain
for those suffering from TT performance issues (such as me).

But I believe that the real benefit would be not being restrained to
what TT can and cannot do while reaping the benefits of using
templates. I imagine using this feature for bits of code here and
there. But those small bits could make my life much easier sometimes.

Actually, now that I'm really thinking about it, I don't really think
this suggestion would help HTML::Widget situation much, since you'd
still need to process the incoming form data in your controller. But,
IMO, the Perl code layer concept retains its usefullness nevertheless.

-Nilson Santos F. Jr.



More information about the Catalyst mailing list